@plusscommunities/pluss-maintenance-web-a 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 +1058 -979
- package/dist/index.js.map +1 -1
- package/package.json +3 -7
package/dist/index.js
CHANGED
|
@@ -1,117 +1,82 @@
|
|
|
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
|
|
8
|
+
import { Icon } from '@plusscommunities/pluss-icons';
|
|
7
9
|
import * as PlussCore from '@plusscommunities/pluss-core-web';
|
|
8
|
-
import { Colours as Colours$
|
|
9
|
-
import { Table,
|
|
10
|
+
import { PERMISSION_CATEGORIES, IMPORTANCE_LEVELS, Colours as Colours$4 } from '@plusscommunities/pluss-core-web';
|
|
11
|
+
import { Table, MenuItem, DropdownButton } from 'react-bootstrap';
|
|
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:
|
|
52
|
-
aliases: [
|
|
53
|
-
serviceKey:
|
|
54
|
-
reducerKey:
|
|
55
|
-
analyticsKey:
|
|
56
|
-
commentKey:
|
|
57
|
-
actionJobsLoaded:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
svgPathGridIconViewBox: '0 0 30 30',
|
|
17
|
+
featureKey: "maintenanceA",
|
|
18
|
+
aliases: ["maintenanceTrackingA", "maintenanceTypesA", "maintenancerequestA"],
|
|
19
|
+
serviceKey: "maintenanceA",
|
|
20
|
+
reducerKey: "maintenanceA",
|
|
21
|
+
analyticsKey: "maintenancerequestA",
|
|
22
|
+
commentKey: "maintenanceA",
|
|
23
|
+
actionJobsLoaded: "JOBS_LOADEDA",
|
|
24
|
+
actionJobsRemoved: "JOBS_REMOVEDA",
|
|
25
|
+
actionJobsTypesLoaded: "JOBS_TYPES_LOADEDA",
|
|
26
|
+
actionJobsStatusesLoaded: "JOBS_STATUSES_LOADEDA",
|
|
27
|
+
actionJobsHideSeen: "JOBS_HIDE_UNSEENA",
|
|
28
|
+
actionJobsLoading: "JOBS_LOADINGA",
|
|
29
|
+
permissionMaintenanceTracking: "maintenanceTrackingA",
|
|
30
|
+
permissionMaintenanceTypes: "maintenanceTypesA",
|
|
31
|
+
permissionMaintenanceAssignment: "maintenanceAssignmentA",
|
|
32
|
+
activityMaintenanceJobStatusChanged: "MaintenanceJobStatusChangedA",
|
|
33
|
+
activityAddMaintenanceJob: "AddMaintenanceJobA",
|
|
34
|
+
activityEditMaintenanceJob: "EditMaintenanceJobA",
|
|
35
|
+
activityDeleteMaintenanceJob: "DeleteMaintenanceJobA",
|
|
36
|
+
routeRequestsHub: "/requestsHubA",
|
|
37
|
+
routeAddRequest: "/requestsHubA/job",
|
|
38
|
+
routeAddRequestType: "/requestsHubA/requestType",
|
|
39
|
+
routeRequestDetails: "/requestsHubA/jobDetails",
|
|
40
|
+
routeRequestTypes: "/requestTypesA",
|
|
41
|
+
screenRequestsHub: "RequestsHubA",
|
|
42
|
+
screenAddJob: "AddJobA",
|
|
43
|
+
screenAddJobType: "AddJobTypeA",
|
|
44
|
+
screenJob: "JobA",
|
|
45
|
+
screenJobTypes: "JobTypesA",
|
|
46
|
+
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",
|
|
47
|
+
svgPathGridIconViewBox: "0 0 30 30",
|
|
83
48
|
menuOrder: 10,
|
|
84
|
-
optionOnlyForResidents:
|
|
85
|
-
textEmptyDescription:
|
|
86
|
-
textEmptyExample:
|
|
87
|
-
textAreYouSureYouWantToDelete:
|
|
88
|
-
textAreYouSureYouWantToDeleteNote:
|
|
49
|
+
optionOnlyForResidents: "onlyForResidentsMaintenanceA",
|
|
50
|
+
textEmptyDescription: "allows your users to submit Requests (such as maintenance requests) that all appear in this job board.",
|
|
51
|
+
textEmptyExample: "Example might be; Fix my light bulb, hand rail is broken, or please send flowers to Mum.",
|
|
52
|
+
textAreYouSureYouWantToDelete: "Are you sure you want to delete that request?",
|
|
53
|
+
textAreYouSureYouWantToDeleteNote: "Are you sure you want to delete that note?",
|
|
89
54
|
textChangedRequestStatus: "changed a maintenance request's status:",
|
|
90
|
-
textAddedRequest:
|
|
91
|
-
textEditedRequest:
|
|
92
|
-
textRemovedRequest:
|
|
93
|
-
textSingularName:
|
|
94
|
-
textYourRequestHere:
|
|
95
|
-
textTitleRequests:
|
|
96
|
-
textMenuTitle:
|
|
97
|
-
textPermissionMaintenanceTracking:
|
|
98
|
-
textPermissionManageMaintenanceTypes:
|
|
99
|
-
textPermissionManageAssignedMaintenance:
|
|
100
|
-
textHiddenSectionMaintenanceRequests:
|
|
101
|
-
keyHiddenSectionMaintenanceRequests:
|
|
102
|
-
textMoreSectionMaintenance:
|
|
103
|
-
featureKeyMoreSectionMaintenance:
|
|
104
|
-
optionKeyMoreSectionMaintenance:
|
|
105
|
-
hiddenKeyMoreSectionMaintenance:
|
|
55
|
+
textAddedRequest: "added a maintenance request:",
|
|
56
|
+
textEditedRequest: "edited a maintenance request:",
|
|
57
|
+
textRemovedRequest: "removed a maintenance request:",
|
|
58
|
+
textSingularName: "Request",
|
|
59
|
+
textYourRequestHere: "Your Requests will show here",
|
|
60
|
+
textTitleRequests: "Requests",
|
|
61
|
+
textMenuTitle: "Maintenance A",
|
|
62
|
+
textPermissionMaintenanceTracking: "Maintenance Tracking A",
|
|
63
|
+
textPermissionManageMaintenanceTypes: "Manage Maintenance Types A",
|
|
64
|
+
textPermissionManageAssignedMaintenance: "Manage Assigned Maintenance A",
|
|
65
|
+
textHiddenSectionMaintenanceRequests: "Maintenance requests A",
|
|
66
|
+
keyHiddenSectionMaintenanceRequests: "maintenanceRequestA",
|
|
67
|
+
textMoreSectionMaintenance: "Maintenance A",
|
|
68
|
+
featureKeyMoreSectionMaintenance: "maintenanceA",
|
|
69
|
+
optionKeyMoreSectionMaintenance: "maintenanceRequestA",
|
|
70
|
+
hiddenKeyMoreSectionMaintenance: "maintenanceRequestA",
|
|
106
71
|
forceCustomFields: false,
|
|
107
|
-
textEntityName:
|
|
108
|
-
stringConfigJobStatus:
|
|
109
|
-
stringConfigHideSeen:
|
|
72
|
+
textEntityName: "Job",
|
|
73
|
+
stringConfigJobStatus: "maintenanceJobStatusA",
|
|
74
|
+
stringConfigHideSeen: "maintenanceDisableSeenA",
|
|
110
75
|
// Comment subscription notification preference
|
|
111
76
|
notificationPreference: {
|
|
112
|
-
key:
|
|
113
|
-
label:
|
|
114
|
-
permission:
|
|
77
|
+
key: "maintenancerequestAComments",
|
|
78
|
+
label: "Maintenance A comments",
|
|
79
|
+
permission: "maintenanceTrackingA"
|
|
115
80
|
}
|
|
116
81
|
};
|
|
117
82
|
|
|
@@ -120,7 +85,7 @@ var FeatureConfig = {
|
|
|
120
85
|
key: values.featureKey,
|
|
121
86
|
aliases: values.aliases,
|
|
122
87
|
singularName: values.textSingularName,
|
|
123
|
-
description:
|
|
88
|
+
description: "Submit maintenance requests and track the progress.",
|
|
124
89
|
emptyText: values.textYourRequestHere,
|
|
125
90
|
widgetOptions: [{
|
|
126
91
|
key: values.featureKey,
|
|
@@ -128,10 +93,10 @@ var FeatureConfig = {
|
|
|
128
93
|
main: true,
|
|
129
94
|
hideOnTabNumbers: [],
|
|
130
95
|
optionKey: values.optionOnlyForResidents,
|
|
131
|
-
type:
|
|
96
|
+
type: "toggle",
|
|
132
97
|
inverseOption: false,
|
|
133
|
-
title:
|
|
134
|
-
description:
|
|
98
|
+
title: "Limit Admins to Only Submit on Behalf of Primary Users",
|
|
99
|
+
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.",
|
|
135
100
|
defaultNew: false,
|
|
136
101
|
default: false
|
|
137
102
|
}],
|
|
@@ -144,20 +109,20 @@ var FeatureConfig = {
|
|
|
144
109
|
url: values.routeRequestsHub,
|
|
145
110
|
countProps: null,
|
|
146
111
|
visibleExps: {
|
|
147
|
-
type:
|
|
112
|
+
type: "and",
|
|
148
113
|
exps: [{
|
|
149
|
-
type:
|
|
114
|
+
type: "feature",
|
|
150
115
|
value: values.featureKey
|
|
151
116
|
}, {
|
|
152
|
-
type:
|
|
117
|
+
type: "or",
|
|
153
118
|
exps: [{
|
|
154
|
-
type:
|
|
119
|
+
type: "permission",
|
|
155
120
|
value: values.permissionMaintenanceTracking
|
|
156
121
|
}, {
|
|
157
|
-
type:
|
|
122
|
+
type: "permission",
|
|
158
123
|
value: values.permissionMaintenanceTypes
|
|
159
124
|
}, {
|
|
160
|
-
type:
|
|
125
|
+
type: "permission",
|
|
161
126
|
value: values.permissionMaintenanceAssignment
|
|
162
127
|
}]
|
|
163
128
|
}]
|
|
@@ -169,15 +134,24 @@ var FeatureConfig = {
|
|
|
169
134
|
permissions: [{
|
|
170
135
|
displayName: values.textPermissionMaintenanceTracking,
|
|
171
136
|
key: values.permissionMaintenanceTracking,
|
|
172
|
-
hq: false
|
|
137
|
+
hq: false,
|
|
138
|
+
category: PERMISSION_CATEGORIES.FACILITIES_BOOKINGS,
|
|
139
|
+
helperText: "Allows tracking and managing maintenance requests and job status updates.",
|
|
140
|
+
importance: IMPORTANCE_LEVELS.IMPORTANT
|
|
173
141
|
}, {
|
|
174
142
|
displayName: values.textPermissionManageMaintenanceTypes,
|
|
175
143
|
key: values.permissionMaintenanceTypes,
|
|
176
|
-
hq: false
|
|
144
|
+
hq: false,
|
|
145
|
+
category: PERMISSION_CATEGORIES.FACILITIES_BOOKINGS,
|
|
146
|
+
helperText: "Allows creating and configuring maintenance request types and categories.",
|
|
147
|
+
importance: IMPORTANCE_LEVELS.IMPORTANT
|
|
177
148
|
}, {
|
|
178
149
|
displayName: values.textPermissionManageAssignedMaintenance,
|
|
179
150
|
key: values.permissionMaintenanceAssignment,
|
|
180
|
-
hq: false
|
|
151
|
+
hq: false,
|
|
152
|
+
category: PERMISSION_CATEGORIES.FACILITIES_BOOKINGS,
|
|
153
|
+
helperText: "Allows assigning and managing assigned maintenance requests.",
|
|
154
|
+
importance: IMPORTANCE_LEVELS.IMPORTANT
|
|
181
155
|
}],
|
|
182
156
|
hiddenSections: [{
|
|
183
157
|
displayName: values.textHiddenSectionMaintenanceRequests,
|
|
@@ -222,21 +196,21 @@ var FeatureConfig = {
|
|
|
222
196
|
exact: true
|
|
223
197
|
}],
|
|
224
198
|
env: {
|
|
225
|
-
baseStage:
|
|
226
|
-
baseAPIUrl:
|
|
227
|
-
baseUploadsUrl:
|
|
228
|
-
uploadBucket:
|
|
229
|
-
colourBrandingMain:
|
|
230
|
-
colourBrandingOff:
|
|
231
|
-
colourBrandingApp:
|
|
232
|
-
defaultProfileImage:
|
|
233
|
-
utcOffset:
|
|
199
|
+
baseStage: "",
|
|
200
|
+
baseAPIUrl: "",
|
|
201
|
+
baseUploadsUrl: "",
|
|
202
|
+
uploadBucket: "",
|
|
203
|
+
colourBrandingMain: "",
|
|
204
|
+
colourBrandingOff: "",
|
|
205
|
+
colourBrandingApp: "",
|
|
206
|
+
defaultProfileImage: "",
|
|
207
|
+
utcOffset: "",
|
|
234
208
|
hasAvailableNews: false,
|
|
235
209
|
newsHaveTags: true,
|
|
236
210
|
defaultAllowComments: true,
|
|
237
|
-
makeApiKey:
|
|
238
|
-
logo:
|
|
239
|
-
clientName:
|
|
211
|
+
makeApiKey: "",
|
|
212
|
+
logo: "",
|
|
213
|
+
clientName: ""
|
|
240
214
|
},
|
|
241
215
|
init: environment => {
|
|
242
216
|
FeatureConfig.env = environment;
|
|
@@ -245,51 +219,24 @@ var FeatureConfig = {
|
|
|
245
219
|
notificationPreference: values.notificationPreference
|
|
246
220
|
};
|
|
247
221
|
|
|
248
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
249
|
-
try {
|
|
250
|
-
var i = n[a](c),
|
|
251
|
-
u = i.value;
|
|
252
|
-
} catch (n) {
|
|
253
|
-
return void e(n);
|
|
254
|
-
}
|
|
255
|
-
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
256
|
-
}
|
|
257
|
-
function _asyncToGenerator(n) {
|
|
258
|
-
return function () {
|
|
259
|
-
var t = this,
|
|
260
|
-
e = arguments;
|
|
261
|
-
return new Promise(function (r, o) {
|
|
262
|
-
var a = n.apply(t, e);
|
|
263
|
-
function _next(n) {
|
|
264
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
265
|
-
}
|
|
266
|
-
function _throw(n) {
|
|
267
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
268
|
-
}
|
|
269
|
-
_next(void 0);
|
|
270
|
-
});
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
|
|
274
222
|
var JOBS_LOADED = values.actionJobsLoaded;
|
|
275
|
-
var JOBS_ADDED = values.actionJobsAdded;
|
|
276
223
|
var JOBS_LOADING = values.actionJobsLoading;
|
|
277
224
|
var JOBS_REMOVED = values.actionJobsRemoved;
|
|
278
225
|
var JOBS_TYPES_LOADED = values.actionJobsTypesLoaded;
|
|
279
226
|
var JOBS_STATUSES_LOADED = values.actionJobsStatusesLoaded;
|
|
280
227
|
var JOBS_HIDE_SEEN = values.actionJobsHideSeen;
|
|
281
228
|
|
|
282
|
-
function ownKeys$
|
|
283
|
-
function _objectSpread$
|
|
229
|
+
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; }
|
|
230
|
+
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; }
|
|
284
231
|
var {
|
|
285
|
-
Helper: Helper$
|
|
232
|
+
Helper: Helper$6,
|
|
286
233
|
Session: Session$9
|
|
287
234
|
} = PlussCore;
|
|
288
235
|
var maintenanceActions = {
|
|
289
236
|
getJobType: (site, typeId) => {
|
|
290
|
-
var url = Helper$
|
|
237
|
+
var url = Helper$6.getUrl(values.serviceKey, "getjobtype");
|
|
291
238
|
return Session$9.authedFunction({
|
|
292
|
-
method:
|
|
239
|
+
method: "POST",
|
|
293
240
|
url,
|
|
294
241
|
data: {
|
|
295
242
|
site,
|
|
@@ -298,9 +245,9 @@ var maintenanceActions = {
|
|
|
298
245
|
});
|
|
299
246
|
},
|
|
300
247
|
getJobTypes: (site, id) => {
|
|
301
|
-
var url = Helper$
|
|
248
|
+
var url = Helper$6.getUrl(values.serviceKey, "getjobtypes");
|
|
302
249
|
return Session$9.authedFunction({
|
|
303
|
-
method:
|
|
250
|
+
method: "POST",
|
|
304
251
|
url,
|
|
305
252
|
data: {
|
|
306
253
|
site
|
|
@@ -308,9 +255,9 @@ var maintenanceActions = {
|
|
|
308
255
|
});
|
|
309
256
|
},
|
|
310
257
|
getJob: (site, id) => {
|
|
311
|
-
var url = Helper$
|
|
258
|
+
var url = Helper$6.getUrl(values.serviceKey, "getJob");
|
|
312
259
|
return Session$9.authedFunction({
|
|
313
|
-
method:
|
|
260
|
+
method: "POST",
|
|
314
261
|
url,
|
|
315
262
|
data: {
|
|
316
263
|
site,
|
|
@@ -319,9 +266,9 @@ var maintenanceActions = {
|
|
|
319
266
|
});
|
|
320
267
|
},
|
|
321
268
|
getJobByJobId: (site, jobId) => {
|
|
322
|
-
var url = Helper$
|
|
269
|
+
var url = Helper$6.getUrl(values.serviceKey, "getJob");
|
|
323
270
|
return Session$9.authedFunction({
|
|
324
|
-
method:
|
|
271
|
+
method: "POST",
|
|
325
272
|
url,
|
|
326
273
|
data: {
|
|
327
274
|
site,
|
|
@@ -330,11 +277,11 @@ var maintenanceActions = {
|
|
|
330
277
|
});
|
|
331
278
|
},
|
|
332
279
|
getJobs: function getJobs(site) {
|
|
333
|
-
var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
334
|
-
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] :
|
|
280
|
+
var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
281
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
335
282
|
return Session$9.authedFunction({
|
|
336
|
-
method:
|
|
337
|
-
url: Helper$
|
|
283
|
+
method: "POST",
|
|
284
|
+
url: Helper$6.getUrl(values.serviceKey, "getJobs"),
|
|
338
285
|
data: {
|
|
339
286
|
site,
|
|
340
287
|
status,
|
|
@@ -342,67 +289,47 @@ var maintenanceActions = {
|
|
|
342
289
|
}
|
|
343
290
|
});
|
|
344
291
|
},
|
|
345
|
-
getJobs2: (site, status,
|
|
292
|
+
getJobs2: (site, status, type, lastKey) => {
|
|
346
293
|
var query = {
|
|
347
294
|
site
|
|
348
295
|
};
|
|
349
296
|
if (status) {
|
|
350
297
|
query.status = status;
|
|
351
298
|
}
|
|
352
|
-
if (priority) {
|
|
353
|
-
query.priority = priority;
|
|
354
|
-
}
|
|
355
299
|
if (type) {
|
|
356
300
|
query.type = type;
|
|
357
301
|
}
|
|
358
302
|
if (lastKey) {
|
|
359
303
|
query.lastKey = JSON.stringify(lastKey);
|
|
360
304
|
}
|
|
361
|
-
if (assignee) {
|
|
362
|
-
query.assignee = assignee;
|
|
363
|
-
}
|
|
364
|
-
if (startTime) {
|
|
365
|
-
query.startTime = startTime;
|
|
366
|
-
}
|
|
367
|
-
if (endTime) {
|
|
368
|
-
query.endTime = endTime;
|
|
369
|
-
}
|
|
370
|
-
if (search) {
|
|
371
|
-
query.search = search;
|
|
372
|
-
}
|
|
373
305
|
return Session$9.authedFunction({
|
|
374
|
-
method:
|
|
375
|
-
url: Helper$
|
|
306
|
+
method: "GET",
|
|
307
|
+
url: Helper$6.getUrl(values.serviceKey, "get/requests", query)
|
|
376
308
|
});
|
|
377
309
|
},
|
|
378
|
-
/**
|
|
379
|
-
* @deprecated Use getJobs2 with pagination instead.
|
|
380
|
-
* This method recursively fetches ALL pages which can be slow for large datasets.
|
|
381
|
-
* For better performance, use getJobs2 directly and implement pagination in the UI.
|
|
382
|
-
*/
|
|
383
310
|
getJobsRecursive: function getJobsRecursive(site, status, type, lastKey) {
|
|
384
311
|
var jobs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
385
|
-
return new Promise(
|
|
386
|
-
maintenanceActions.getJobs2(site, status,
|
|
312
|
+
return new Promise(resolve => {
|
|
313
|
+
maintenanceActions.getJobs2(site, status, type, lastKey).then(jobRes => {
|
|
387
314
|
var newJobs = [...jobs, ...jobRes.data.Items];
|
|
388
315
|
if (!jobRes.data.LastKey) {
|
|
389
316
|
return resolve(newJobs);
|
|
390
317
|
}
|
|
391
|
-
maintenanceActions.getJobsRecursive(site, status, type, jobRes.data.LastKey, newJobs)
|
|
392
|
-
})
|
|
318
|
+
return resolve(maintenanceActions.getJobsRecursive(site, status, type, jobRes.data.LastKey, newJobs));
|
|
319
|
+
});
|
|
393
320
|
});
|
|
394
321
|
},
|
|
395
322
|
createJob: job => {
|
|
396
323
|
return Session$9.authedFunction({
|
|
397
|
-
method:
|
|
398
|
-
url: Helper$
|
|
399
|
-
data: _objectSpread$
|
|
324
|
+
method: "POST",
|
|
325
|
+
url: Helper$6.getUrl(values.serviceKey, "sendMaintenance"),
|
|
326
|
+
data: _objectSpread$8({}, job)
|
|
400
327
|
});
|
|
401
328
|
},
|
|
402
329
|
editJob: (job, site) => {
|
|
403
330
|
return Session$9.authedFunction({
|
|
404
|
-
method:
|
|
405
|
-
url: Helper$
|
|
331
|
+
method: "POST",
|
|
332
|
+
url: Helper$6.getUrl(values.serviceKey, "editJob"),
|
|
406
333
|
data: {
|
|
407
334
|
job,
|
|
408
335
|
site
|
|
@@ -411,8 +338,8 @@ var maintenanceActions = {
|
|
|
411
338
|
},
|
|
412
339
|
deleteJob: (site, id) => {
|
|
413
340
|
return Session$9.authedFunction({
|
|
414
|
-
method:
|
|
415
|
-
url: Helper$
|
|
341
|
+
method: "POST",
|
|
342
|
+
url: Helper$6.getUrl(values.serviceKey, "requests/remove"),
|
|
416
343
|
data: {
|
|
417
344
|
site,
|
|
418
345
|
id
|
|
@@ -421,8 +348,8 @@ var maintenanceActions = {
|
|
|
421
348
|
},
|
|
422
349
|
editJobStatus: (id, status) => {
|
|
423
350
|
return Session$9.authedFunction({
|
|
424
|
-
method:
|
|
425
|
-
url: Helper$
|
|
351
|
+
method: "POST",
|
|
352
|
+
url: Helper$6.getUrl(values.serviceKey, "editJobStatus"),
|
|
426
353
|
data: {
|
|
427
354
|
id,
|
|
428
355
|
status
|
|
@@ -431,8 +358,8 @@ var maintenanceActions = {
|
|
|
431
358
|
},
|
|
432
359
|
editJobPriority: (id, priority) => {
|
|
433
360
|
return Session$9.authedFunction({
|
|
434
|
-
method:
|
|
435
|
-
url: Helper$
|
|
361
|
+
method: "POST",
|
|
362
|
+
url: Helper$6.getUrl(values.serviceKey, "update/priority"),
|
|
436
363
|
data: {
|
|
437
364
|
id,
|
|
438
365
|
priority
|
|
@@ -441,8 +368,8 @@ var maintenanceActions = {
|
|
|
441
368
|
},
|
|
442
369
|
assignJob: (jobId, userId) => {
|
|
443
370
|
return Session$9.authedFunction({
|
|
444
|
-
method:
|
|
445
|
-
url: Helper$
|
|
371
|
+
method: "POST",
|
|
372
|
+
url: Helper$6.getUrl(values.serviceKey, "update/assign"),
|
|
446
373
|
data: {
|
|
447
374
|
id: jobId,
|
|
448
375
|
userId
|
|
@@ -451,47 +378,47 @@ var maintenanceActions = {
|
|
|
451
378
|
},
|
|
452
379
|
getAssignees: site => {
|
|
453
380
|
return Session$9.authedFunction({
|
|
454
|
-
method:
|
|
455
|
-
url: Helper$
|
|
381
|
+
method: "GET",
|
|
382
|
+
url: Helper$6.getUrl(values.serviceKey, "get/assignees", {
|
|
456
383
|
site
|
|
457
384
|
})
|
|
458
385
|
});
|
|
459
386
|
},
|
|
460
387
|
addNote: (jobId, note, attachments, images) => {
|
|
461
388
|
return Session$9.authedFunction({
|
|
462
|
-
method:
|
|
463
|
-
url: Helper$
|
|
389
|
+
method: "POST",
|
|
390
|
+
url: Helper$6.getUrl(values.serviceKey, "requests/note"),
|
|
464
391
|
data: {
|
|
465
392
|
id: jobId,
|
|
466
393
|
note,
|
|
467
394
|
attachments,
|
|
468
395
|
images,
|
|
469
|
-
action:
|
|
396
|
+
action: "AddNote"
|
|
470
397
|
}
|
|
471
398
|
});
|
|
472
399
|
},
|
|
473
400
|
editNote: (jobId, noteId, note, attachments, images) => {
|
|
474
401
|
return Session$9.authedFunction({
|
|
475
|
-
method:
|
|
476
|
-
url: Helper$
|
|
402
|
+
method: "POST",
|
|
403
|
+
url: Helper$6.getUrl(values.serviceKey, "requests/note"),
|
|
477
404
|
data: {
|
|
478
405
|
id: jobId,
|
|
479
406
|
note,
|
|
480
407
|
attachments,
|
|
481
408
|
images,
|
|
482
409
|
noteId,
|
|
483
|
-
action:
|
|
410
|
+
action: "EditNote"
|
|
484
411
|
}
|
|
485
412
|
});
|
|
486
413
|
},
|
|
487
414
|
deleteNote: (jobId, noteId) => {
|
|
488
415
|
return Session$9.authedFunction({
|
|
489
|
-
method:
|
|
490
|
-
url: Helper$
|
|
416
|
+
method: "POST",
|
|
417
|
+
url: Helper$6.getUrl(values.serviceKey, "requests/note"),
|
|
491
418
|
data: {
|
|
492
419
|
id: jobId,
|
|
493
420
|
noteId,
|
|
494
|
-
action:
|
|
421
|
+
action: "DeleteNote"
|
|
495
422
|
}
|
|
496
423
|
});
|
|
497
424
|
},
|
|
@@ -506,8 +433,8 @@ var maintenanceActions = {
|
|
|
506
433
|
customFields: customFields || []
|
|
507
434
|
};
|
|
508
435
|
return Session$9.authedFunction({
|
|
509
|
-
method:
|
|
510
|
-
url: Helper$
|
|
436
|
+
method: "POST",
|
|
437
|
+
url: Helper$6.getUrl(values.serviceKey, "createJobType"),
|
|
511
438
|
data
|
|
512
439
|
});
|
|
513
440
|
},
|
|
@@ -524,15 +451,15 @@ var maintenanceActions = {
|
|
|
524
451
|
};
|
|
525
452
|
if (hasCustomFields && customFields) data.customFields = customFields;
|
|
526
453
|
return Session$9.authedFunction({
|
|
527
|
-
method:
|
|
528
|
-
url: Helper$
|
|
454
|
+
method: "POST",
|
|
455
|
+
url: Helper$6.getUrl(values.serviceKey, "editJobType"),
|
|
529
456
|
data
|
|
530
457
|
});
|
|
531
458
|
},
|
|
532
459
|
deleteJobType: (site, id) => {
|
|
533
460
|
return Session$9.authedFunction({
|
|
534
|
-
method:
|
|
535
|
-
url: Helper$
|
|
461
|
+
method: "POST",
|
|
462
|
+
url: Helper$6.getUrl(values.serviceKey, "deleteJobType"),
|
|
536
463
|
data: {
|
|
537
464
|
site,
|
|
538
465
|
id
|
|
@@ -541,16 +468,16 @@ var maintenanceActions = {
|
|
|
541
468
|
},
|
|
542
469
|
getExternalSync: jobId => {
|
|
543
470
|
return Session$9.authedFunction({
|
|
544
|
-
method:
|
|
545
|
-
url: Helper$
|
|
471
|
+
method: "GET",
|
|
472
|
+
url: Helper$6.getUrl(values.serviceKey, "get/externalsync", {
|
|
546
473
|
id: jobId
|
|
547
474
|
})
|
|
548
475
|
});
|
|
549
476
|
},
|
|
550
477
|
retrySync: jobId => {
|
|
551
478
|
return Session$9.authedFunction({
|
|
552
|
-
method:
|
|
553
|
-
url: Helper$
|
|
479
|
+
method: "POST",
|
|
480
|
+
url: Helper$6.getUrl(values.serviceKey, "update/retrysync"),
|
|
554
481
|
data: {
|
|
555
482
|
id: jobId
|
|
556
483
|
}
|
|
@@ -559,7 +486,7 @@ var maintenanceActions = {
|
|
|
559
486
|
};
|
|
560
487
|
|
|
561
488
|
var {
|
|
562
|
-
Helper: Helper$
|
|
489
|
+
Helper: Helper$5,
|
|
563
490
|
Session: Session$8
|
|
564
491
|
} = PlussCore;
|
|
565
492
|
var reactionActions = {
|
|
@@ -576,8 +503,8 @@ var reactionActions = {
|
|
|
576
503
|
data.image = image;
|
|
577
504
|
}
|
|
578
505
|
return Session$8.authedFunction({
|
|
579
|
-
method:
|
|
580
|
-
url: Helper$
|
|
506
|
+
method: "POST",
|
|
507
|
+
url: Helper$5.getUrl("reactions", "comments/add"),
|
|
581
508
|
data
|
|
582
509
|
});
|
|
583
510
|
},
|
|
@@ -599,8 +526,8 @@ var reactionActions = {
|
|
|
599
526
|
query.minTime = minTime;
|
|
600
527
|
}
|
|
601
528
|
return Session$8.authedFunction({
|
|
602
|
-
method:
|
|
603
|
-
url: Helper$
|
|
529
|
+
method: "GET",
|
|
530
|
+
url: Helper$5.getUrl("reactions", "comments/get", query)
|
|
604
531
|
});
|
|
605
532
|
}
|
|
606
533
|
};
|
|
@@ -634,20 +561,19 @@ var jobStatusOptions = [
|
|
|
634
561
|
];
|
|
635
562
|
|
|
636
563
|
var {
|
|
637
|
-
Helper: Helper$
|
|
564
|
+
Helper: Helper$4
|
|
638
565
|
} = PlussCore;
|
|
639
566
|
var jobsUpdate = (site, isdashboard) => {
|
|
640
567
|
return dispatch => {
|
|
641
568
|
if (isdashboard) dispatch({
|
|
642
569
|
type: JOBS_LOADING
|
|
643
570
|
});
|
|
644
|
-
maintenanceActions.
|
|
645
|
-
var currentSite = Helper$
|
|
646
|
-
|
|
647
|
-
if (!_.isEmpty(jobs) && jobs[0].site === currentSite) {
|
|
571
|
+
maintenanceActions.getJobsRecursive(site).then(res => {
|
|
572
|
+
var currentSite = Helper$4.readStorageWithCookie("site");
|
|
573
|
+
if (!_.isEmpty(res) && res[0].site === currentSite) {
|
|
648
574
|
dispatch({
|
|
649
575
|
type: JOBS_LOADED,
|
|
650
|
-
payload:
|
|
576
|
+
payload: res
|
|
651
577
|
});
|
|
652
578
|
} else {
|
|
653
579
|
dispatch({
|
|
@@ -655,12 +581,6 @@ var jobsUpdate = (site, isdashboard) => {
|
|
|
655
581
|
payload: []
|
|
656
582
|
});
|
|
657
583
|
}
|
|
658
|
-
}).catch(error => {
|
|
659
|
-
console.error('jobsUpdate error', error);
|
|
660
|
-
dispatch({
|
|
661
|
-
type: JOBS_LOADED,
|
|
662
|
-
payload: []
|
|
663
|
-
});
|
|
664
584
|
});
|
|
665
585
|
};
|
|
666
586
|
};
|
|
@@ -670,12 +590,6 @@ var jobsLoaded = events => {
|
|
|
670
590
|
payload: events
|
|
671
591
|
};
|
|
672
592
|
};
|
|
673
|
-
var jobsAdded = events => {
|
|
674
|
-
return {
|
|
675
|
-
type: JOBS_ADDED,
|
|
676
|
-
payload: events
|
|
677
|
-
};
|
|
678
|
-
};
|
|
679
593
|
var removeJob = id => {
|
|
680
594
|
return {
|
|
681
595
|
type: JOBS_REMOVED,
|
|
@@ -796,10 +710,10 @@ var jobPriorityOptions = [
|
|
|
796
710
|
}
|
|
797
711
|
];
|
|
798
712
|
|
|
799
|
-
var STATUS_IMCOMPLETE =
|
|
800
|
-
var STATUS_NOT_ACTIONED =
|
|
801
|
-
var STATUS_IN_PROGRESS =
|
|
802
|
-
var STATUS_COMPLETED =
|
|
713
|
+
var STATUS_IMCOMPLETE = "All Incomplete";
|
|
714
|
+
var STATUS_NOT_ACTIONED = "Not Actioned";
|
|
715
|
+
var STATUS_IN_PROGRESS = "In Progress";
|
|
716
|
+
var STATUS_COMPLETED = "Completed";
|
|
803
717
|
var getDefaultPriority = () => jobPriorityOptions.find(p => p.default);
|
|
804
718
|
var getJobPriority = priority => {
|
|
805
719
|
var priorityOption = null;
|
|
@@ -807,8 +721,8 @@ var getJobPriority = priority => {
|
|
|
807
721
|
return priorityOption || getDefaultPriority();
|
|
808
722
|
};
|
|
809
723
|
|
|
810
|
-
function ownKeys$
|
|
811
|
-
function _objectSpread$
|
|
724
|
+
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; }
|
|
725
|
+
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; }
|
|
812
726
|
var {
|
|
813
727
|
Session: Session$7,
|
|
814
728
|
Components: Components$7,
|
|
@@ -824,75 +738,25 @@ class JobList extends Component {
|
|
|
824
738
|
id: j.userID,
|
|
825
739
|
displayName: j.userName,
|
|
826
740
|
profilePic: j.userProfilePic
|
|
827
|
-
})),
|
|
741
|
+
})), "id"), "displayName", "asc");
|
|
828
742
|
this.setState({
|
|
829
743
|
requesters
|
|
830
744
|
});
|
|
831
745
|
});
|
|
832
|
-
_defineProperty(this, "
|
|
833
|
-
var {
|
|
834
|
-
auth
|
|
835
|
-
} = this.props;
|
|
836
|
-
this.setState({
|
|
837
|
-
loading: true,
|
|
838
|
-
lastKey: null,
|
|
839
|
-
hasMore: true
|
|
840
|
-
}, /*#__PURE__*/_asyncToGenerator(function* () {
|
|
841
|
-
try {
|
|
842
|
-
var statusForApi = _this.state.selectedStatusFilter === STATUS_IMCOMPLETE ? undefined : _this.state.selectedStatusFilter;
|
|
843
|
-
var res = yield maintenanceActions.getJobs2(auth.site, statusForApi, _this.state.selectedPriorityFilter, _this.state.selectedTypeFilter, null,
|
|
844
|
-
// first page
|
|
845
|
-
_this.state.selectedUserFilter, _this.state.selectedTimeFilterStart, _this.state.selectedTimeFilterEnd, _this.state.search);
|
|
846
|
-
var jobs = res.data.Items;
|
|
847
|
-
var lastKey = res.data.LastKey;
|
|
848
|
-
_this.setRequesters(jobs);
|
|
849
|
-
_this.props.jobsLoaded(jobs);
|
|
850
|
-
_this.setState({
|
|
851
|
-
lastKey,
|
|
852
|
-
hasMore: !!lastKey,
|
|
853
|
-
loading: false
|
|
854
|
-
});
|
|
855
|
-
} catch (error) {
|
|
856
|
-
console.error('refresh error', error);
|
|
857
|
-
_this.setState({
|
|
858
|
-
loading: false
|
|
859
|
-
});
|
|
860
|
-
}
|
|
861
|
-
}));
|
|
862
|
-
});
|
|
863
|
-
_defineProperty(this, "loadMore", () => {
|
|
746
|
+
_defineProperty(this, "getJobs", /*#__PURE__*/_asyncToGenerator(function* () {
|
|
864
747
|
var {
|
|
865
748
|
auth
|
|
866
|
-
} =
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
} = this.state;
|
|
873
|
-
if (loading || loadingMore || !hasMore || !lastKey) return;
|
|
874
|
-
this.setState({
|
|
875
|
-
loadingMore: true
|
|
876
|
-
}, /*#__PURE__*/_asyncToGenerator(function* () {
|
|
877
|
-
try {
|
|
878
|
-
var statusForApi = _this.state.selectedStatusFilter === STATUS_IMCOMPLETE ? undefined : _this.state.selectedStatusFilter;
|
|
879
|
-
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);
|
|
880
|
-
var newJobs = res.data.Items;
|
|
881
|
-
var newLastKey = res.data.LastKey;
|
|
882
|
-
_this.props.jobsAdded(newJobs);
|
|
883
|
-
_this.setState({
|
|
884
|
-
lastKey: newLastKey,
|
|
885
|
-
hasMore: !!newLastKey,
|
|
886
|
-
loadingMore: false
|
|
887
|
-
});
|
|
888
|
-
} catch (error) {
|
|
889
|
-
console.error('loadMore error', error);
|
|
890
|
-
_this.setState({
|
|
891
|
-
loadingMore: false
|
|
892
|
-
});
|
|
749
|
+
} = _this.props;
|
|
750
|
+
try {
|
|
751
|
+
var res = yield maintenanceActions.getJobsRecursive(auth.site);
|
|
752
|
+
if (!_.isEmpty(res) && res[0].site === auth.site) {
|
|
753
|
+
_this.setRequesters(res);
|
|
754
|
+
_this.props.jobsLoaded(res);
|
|
893
755
|
}
|
|
894
|
-
})
|
|
895
|
-
|
|
756
|
+
} catch (error) {
|
|
757
|
+
console.error("getJobs", error);
|
|
758
|
+
}
|
|
759
|
+
}));
|
|
896
760
|
_defineProperty(this, "getAssignees", /*#__PURE__*/_asyncToGenerator(function* () {
|
|
897
761
|
try {
|
|
898
762
|
var res = yield maintenanceActions.getAssignees(_this.props.auth.site);
|
|
@@ -900,7 +764,7 @@ class JobList extends Component {
|
|
|
900
764
|
assignees: res.data.Users
|
|
901
765
|
});
|
|
902
766
|
} catch (error) {
|
|
903
|
-
console.error(
|
|
767
|
+
console.error("getAssignees", error);
|
|
904
768
|
}
|
|
905
769
|
}));
|
|
906
770
|
_defineProperty(this, "sortByCol", col => {
|
|
@@ -920,20 +784,20 @@ class JobList extends Component {
|
|
|
920
784
|
}
|
|
921
785
|
});
|
|
922
786
|
_defineProperty(this, "onRemoveRequest", /*#__PURE__*/function () {
|
|
923
|
-
var
|
|
787
|
+
var _ref3 = _asyncToGenerator(function* (request) {
|
|
924
788
|
if (window.confirm(values.textAreYouSureYouWantToDelete)) {
|
|
925
789
|
_this.props.removeJob(request.id);
|
|
926
790
|
try {
|
|
927
791
|
yield maintenanceActions.deleteJob(_this.props.auth.site, request.id);
|
|
928
|
-
_this.
|
|
792
|
+
_this.getJobs();
|
|
929
793
|
} catch (error) {
|
|
930
|
-
console.log(
|
|
931
|
-
alert(
|
|
794
|
+
console.log("onRemoveRequest", error);
|
|
795
|
+
alert("Something went wrong with the request. Please try again.");
|
|
932
796
|
}
|
|
933
797
|
}
|
|
934
798
|
});
|
|
935
799
|
return function (_x) {
|
|
936
|
-
return
|
|
800
|
+
return _ref3.apply(this, arguments);
|
|
937
801
|
};
|
|
938
802
|
}());
|
|
939
803
|
_defineProperty(this, "openFilter", filter => {
|
|
@@ -947,22 +811,22 @@ class JobList extends Component {
|
|
|
947
811
|
});
|
|
948
812
|
});
|
|
949
813
|
_defineProperty(this, "selectTypeFilter", filter => {
|
|
950
|
-
this.closeFilter();
|
|
951
814
|
this.setState({
|
|
952
815
|
selectedTypeFilter: filter
|
|
953
|
-
}
|
|
816
|
+
});
|
|
817
|
+
this.closeFilter();
|
|
954
818
|
});
|
|
955
819
|
_defineProperty(this, "selectPriorityFilter", filter => {
|
|
956
|
-
this.closeFilter();
|
|
957
820
|
this.setState({
|
|
958
821
|
selectedPriorityFilter: filter
|
|
959
|
-
}
|
|
822
|
+
});
|
|
823
|
+
this.closeFilter();
|
|
960
824
|
});
|
|
961
825
|
_defineProperty(this, "selectStatusFilter", filter => {
|
|
962
|
-
this.closeFilter();
|
|
963
826
|
this.setState({
|
|
964
827
|
selectedStatusFilter: filter
|
|
965
|
-
}
|
|
828
|
+
});
|
|
829
|
+
this.closeFilter();
|
|
966
830
|
});
|
|
967
831
|
_defineProperty(this, "timeFilterChanged", selectedTimeFilter => {
|
|
968
832
|
this.setState({
|
|
@@ -982,42 +846,42 @@ class JobList extends Component {
|
|
|
982
846
|
if (this.state.selectedTimeFilter.dayCount > 0) {
|
|
983
847
|
return true;
|
|
984
848
|
}
|
|
985
|
-
return moment(this.state.timeFilterStart).startOf(
|
|
849
|
+
return moment(this.state.timeFilterStart).startOf("d").valueOf() < moment(this.state.timeFilterEnd).endOf("d").valueOf();
|
|
986
850
|
});
|
|
987
851
|
_defineProperty(this, "saveTimeFilter", () => {
|
|
988
852
|
if (!this.isValidTimeFilter()) {
|
|
989
853
|
return;
|
|
990
854
|
}
|
|
991
855
|
var startTime = 0;
|
|
992
|
-
var endTime = moment().endOf(
|
|
993
|
-
var text =
|
|
856
|
+
var endTime = moment().endOf("d").valueOf();
|
|
857
|
+
var text = "";
|
|
994
858
|
if (this.state.selectedTimeFilter.dayCount > 0) {
|
|
995
|
-
startTime = moment().add(-this.state.selectedTimeFilter.dayCount,
|
|
859
|
+
startTime = moment().add(-this.state.selectedTimeFilter.dayCount, "d").startOf("d").valueOf();
|
|
996
860
|
text = this.state.selectedTimeFilter.text;
|
|
997
861
|
} else {
|
|
998
|
-
var startDate = moment(this.state.timeFilterStart).startOf(
|
|
999
|
-
var endDate = moment(this.state.timeFilterEnd).endOf(
|
|
862
|
+
var startDate = moment(this.state.timeFilterStart).startOf("d");
|
|
863
|
+
var endDate = moment(this.state.timeFilterEnd).endOf("d");
|
|
1000
864
|
startTime = startDate.valueOf();
|
|
1001
865
|
endTime = endDate.valueOf();
|
|
1002
|
-
text = "".concat(startDate.format(
|
|
866
|
+
text = "".concat(startDate.format("DD/MM/YYYY"), " to ").concat(endDate.format("DD/MM/YYYY"));
|
|
1003
867
|
}
|
|
1004
|
-
this.closeFilter();
|
|
1005
868
|
this.setState({
|
|
1006
869
|
selectedTimeFilterStart: startTime,
|
|
1007
870
|
selectedTimeFilterEnd: endTime,
|
|
1008
871
|
selectedTimeFilterText: text
|
|
1009
|
-
}
|
|
872
|
+
});
|
|
873
|
+
this.closeFilter();
|
|
1010
874
|
});
|
|
1011
875
|
_defineProperty(this, "removeTimeFilter", () => {
|
|
1012
876
|
this.setState({
|
|
1013
877
|
selectedTimeFilterStart: null,
|
|
1014
878
|
selectedTimeFilterEnd: null,
|
|
1015
879
|
selectedTimeFilterText: null
|
|
1016
|
-
}
|
|
880
|
+
});
|
|
1017
881
|
});
|
|
1018
882
|
_defineProperty(this, "onHandleChange", event => {
|
|
1019
883
|
var stateChange = {};
|
|
1020
|
-
stateChange[event.target.getAttribute(
|
|
884
|
+
stateChange[event.target.getAttribute("id")] = event.target.value;
|
|
1021
885
|
this.setState(stateChange);
|
|
1022
886
|
});
|
|
1023
887
|
_defineProperty(this, "onSelectAssignee", user => {
|
|
@@ -1029,10 +893,9 @@ class JobList extends Component {
|
|
|
1029
893
|
this.setState({
|
|
1030
894
|
selectedUserFilter: null,
|
|
1031
895
|
selectedUserFilterText: null
|
|
1032
|
-
}
|
|
896
|
+
});
|
|
1033
897
|
});
|
|
1034
898
|
_defineProperty(this, "saveUserFilter", () => {
|
|
1035
|
-
this.closeFilter();
|
|
1036
899
|
if (!this.state.selectedAssignee) {
|
|
1037
900
|
this.removeUserFilter();
|
|
1038
901
|
} else {
|
|
@@ -1040,8 +903,9 @@ class JobList extends Component {
|
|
|
1040
903
|
selectedUserFilter: this.state.selectedAssignee.id,
|
|
1041
904
|
selectedUserFilterText: this.state.selectedAssignee.displayName,
|
|
1042
905
|
selectedAssignee: null
|
|
1043
|
-
}
|
|
906
|
+
});
|
|
1044
907
|
}
|
|
908
|
+
this.closeFilter();
|
|
1045
909
|
});
|
|
1046
910
|
_defineProperty(this, "onSelectRequester", user => {
|
|
1047
911
|
this.setState({
|
|
@@ -1073,41 +937,82 @@ class JobList extends Component {
|
|
|
1073
937
|
lastSearch: thisSearchTime
|
|
1074
938
|
});
|
|
1075
939
|
setTimeout(() => {
|
|
1076
|
-
//
|
|
940
|
+
// delayed setter to avoid filtering on every keypress
|
|
1077
941
|
if (this.state.lastSearch === thisSearchTime) {
|
|
1078
|
-
this.
|
|
942
|
+
this.setState({
|
|
943
|
+
searchTerm: this.state.search
|
|
944
|
+
});
|
|
1079
945
|
}
|
|
1080
946
|
}, 500);
|
|
1081
947
|
});
|
|
1082
948
|
_defineProperty(this, "getSource", () => {
|
|
1083
949
|
var source = this.props.source;
|
|
1084
950
|
|
|
1085
|
-
//
|
|
1086
|
-
if (this.state.
|
|
951
|
+
// filter by time
|
|
952
|
+
if (this.state.selectedTimeFilterStart && this.state.selectedTimeFilterEnd) {
|
|
953
|
+
source = _.filter(source, r => {
|
|
954
|
+
return r.createdUnix >= this.state.selectedTimeFilterStart && r.createdUnix <= this.state.selectedTimeFilterEnd;
|
|
955
|
+
});
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
// filter by type
|
|
959
|
+
if (this.state.selectedTypeFilter) {
|
|
960
|
+
source = _.filter(source, r => {
|
|
961
|
+
return r.type === this.state.selectedTypeFilter;
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
// filter by priority
|
|
966
|
+
if (this.state.selectedPriorityFilter) {
|
|
967
|
+
var defaultPriority = getDefaultPriority().name;
|
|
968
|
+
source = _.filter(source, r => {
|
|
969
|
+
return r.priority === this.state.selectedPriorityFilter || this.state.selectedPriorityFilter === defaultPriority && _.isNil(r.priority);
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
// filter by status
|
|
974
|
+
if (this.state.selectedStatusFilter) {
|
|
1087
975
|
var {
|
|
1088
976
|
statusTypes
|
|
1089
977
|
} = this.props;
|
|
978
|
+
var defaultStatus = statusTypes.find(s => s.category === STATUS_NOT_ACTIONED);
|
|
1090
979
|
source = _.filter(source, r => {
|
|
1091
|
-
var status = statusTypes.find(s => s.text === r.status);
|
|
1092
|
-
|
|
980
|
+
var status = statusTypes.find(s => s.text === r.status) || defaultStatus;
|
|
981
|
+
if (this.state.selectedStatusFilter === STATUS_IMCOMPLETE) {
|
|
982
|
+
return status.category !== STATUS_COMPLETED;
|
|
983
|
+
}
|
|
984
|
+
return status.text === this.state.selectedStatusFilter;
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
if (this.state.selectedUserFilter) {
|
|
988
|
+
source = _.filter(source, r => {
|
|
989
|
+
return r.AssigneeId === this.state.selectedUserFilter;
|
|
1093
990
|
});
|
|
1094
991
|
}
|
|
1095
|
-
|
|
1096
|
-
// Client-side filter: requester (not supported server-side)
|
|
1097
992
|
if (this.state.selectedRequesterFilter) {
|
|
1098
993
|
source = _.filter(source, r => {
|
|
1099
994
|
return r.userID === this.state.selectedRequesterFilter;
|
|
1100
995
|
});
|
|
1101
996
|
}
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
997
|
+
if (!_.isEmpty(this.state.searchTerm)) {
|
|
998
|
+
source = _.filter(source, r => {
|
|
999
|
+
if (r.jobId && r.jobId === this.state.searchTerm) {
|
|
1000
|
+
return true;
|
|
1001
|
+
}
|
|
1002
|
+
if (r.room && r.room.toLowerCase().indexOf(this.state.searchTerm.toLowerCase()) > -1) {
|
|
1003
|
+
return true;
|
|
1004
|
+
}
|
|
1005
|
+
if (r.title && r.title.toLowerCase().indexOf(this.state.searchTerm.toLowerCase()) > -1) {
|
|
1006
|
+
return true;
|
|
1007
|
+
}
|
|
1008
|
+
return false;
|
|
1009
|
+
});
|
|
1010
|
+
}
|
|
1106
1011
|
source = _.sortBy(source, event => {
|
|
1107
|
-
if (this.state.sortColumn ===
|
|
1108
|
-
return event.Assignee ? event.Assignee.displayName :
|
|
1012
|
+
if (this.state.sortColumn === "assigned") {
|
|
1013
|
+
return event.Assignee ? event.Assignee.displayName : "Unassigned";
|
|
1109
1014
|
}
|
|
1110
|
-
if (this.state.sortColumn !==
|
|
1015
|
+
if (this.state.sortColumn !== "createdUnix") return event[this.state.sortColumn];
|
|
1111
1016
|
return event.createdUnix;
|
|
1112
1017
|
});
|
|
1113
1018
|
if (this.state.sortDesc) source.reverse();
|
|
@@ -1115,14 +1020,14 @@ class JobList extends Component {
|
|
|
1115
1020
|
});
|
|
1116
1021
|
_defineProperty(this, "getCustomFieldValue", field => {
|
|
1117
1022
|
switch (field.type) {
|
|
1118
|
-
case
|
|
1119
|
-
return field.answer ? moment(field.answer,
|
|
1120
|
-
case
|
|
1121
|
-
return field.answer ? moment(field.answer,
|
|
1122
|
-
case
|
|
1123
|
-
return field.answer ?
|
|
1124
|
-
case
|
|
1125
|
-
return field.answer && Array.isArray(field.answer) ? field.answer.join(
|
|
1023
|
+
case "date":
|
|
1024
|
+
return field.answer ? moment(field.answer, "YYYY-MM-DD").format("DD-MMM-YYYY") : "";
|
|
1025
|
+
case "time":
|
|
1026
|
+
return field.answer ? moment(field.answer, "HH:mm").format("h:mm a") : "";
|
|
1027
|
+
case "yn":
|
|
1028
|
+
return field.answer ? "Yes" : "No";
|
|
1029
|
+
case "checkbox":
|
|
1030
|
+
return field.answer && Array.isArray(field.answer) ? field.answer.join(", ") : "";
|
|
1126
1031
|
default:
|
|
1127
1032
|
return field.answer;
|
|
1128
1033
|
}
|
|
@@ -1136,7 +1041,7 @@ class JobList extends Component {
|
|
|
1136
1041
|
if (customFields && Array.isArray(customFields)) {
|
|
1137
1042
|
customFields.forEach(field => {
|
|
1138
1043
|
// Exclude un-exportable fields
|
|
1139
|
-
if ([
|
|
1044
|
+
if (["image", "document", "staticTitle", "staticText"].includes(field.type)) return;
|
|
1140
1045
|
var fieldKey = "".concat(_.camelCase(type), ".").concat(_.camelCase(field.label));
|
|
1141
1046
|
// Build custom columns
|
|
1142
1047
|
var exists = customColumns.find(c => c.key === fieldKey);
|
|
@@ -1158,10 +1063,10 @@ class JobList extends Component {
|
|
|
1158
1063
|
var source = this.getSource().map(r => {
|
|
1159
1064
|
var history = r.history || [];
|
|
1160
1065
|
var progressEntry = _.find(history, e => {
|
|
1161
|
-
return e.status !==
|
|
1066
|
+
return e.status !== "Unassigned";
|
|
1162
1067
|
});
|
|
1163
1068
|
var completedEntry = _.find(history, e => {
|
|
1164
|
-
return e.status ===
|
|
1069
|
+
return e.status === "Completed";
|
|
1165
1070
|
});
|
|
1166
1071
|
var progressTime = null;
|
|
1167
1072
|
var completedTime = null;
|
|
@@ -1175,22 +1080,22 @@ class JobList extends Component {
|
|
|
1175
1080
|
completedTime = moment.utc(completedEntry.timestamp).format();
|
|
1176
1081
|
completedDuration = moment.utc(completedEntry.timestamp).unix() - moment.utc(r.createdTime).unix();
|
|
1177
1082
|
}
|
|
1178
|
-
var notes =
|
|
1083
|
+
var notes = "";
|
|
1179
1084
|
(r.Notes || []).forEach((note, index) => {
|
|
1180
1085
|
if (index > 0) {
|
|
1181
|
-
notes +=
|
|
1086
|
+
notes += "\n\n";
|
|
1182
1087
|
}
|
|
1183
1088
|
if (note.User && !_.isEmpty(note.User.displayName)) {
|
|
1184
1089
|
notes += "".concat(note.User.displayName, ":\n");
|
|
1185
1090
|
}
|
|
1186
1091
|
if (note.Timestamp) {
|
|
1187
|
-
notes += "".concat(moment(note.Timestamp).format(
|
|
1092
|
+
notes += "".concat(moment(note.Timestamp).format("DD-MM-YYYY h:mma"), "\n");
|
|
1188
1093
|
}
|
|
1189
1094
|
notes += note.Note;
|
|
1190
1095
|
});
|
|
1191
1096
|
var customFieldValues = this.getCustomFields(r, customColumns);
|
|
1192
1097
|
var priority = r.priority || defaultPriority;
|
|
1193
|
-
return _objectSpread$
|
|
1098
|
+
return _objectSpread$7(_objectSpread$7(_objectSpread$7({}, r), customFieldValues), {}, {
|
|
1194
1099
|
notes,
|
|
1195
1100
|
progressTime,
|
|
1196
1101
|
completedTime,
|
|
@@ -1201,7 +1106,7 @@ class JobList extends Component {
|
|
|
1201
1106
|
});
|
|
1202
1107
|
|
|
1203
1108
|
// Compose revised columns list with custom fields
|
|
1204
|
-
var index = this.exportColumns.findIndex(c => c.key ===
|
|
1109
|
+
var index = this.exportColumns.findIndex(c => c.key === "notes");
|
|
1205
1110
|
var columns = [...this.exportColumns.slice(0, index), ...customColumns, ...this.exportColumns.slice(index)];
|
|
1206
1111
|
return {
|
|
1207
1112
|
columns,
|
|
@@ -1223,67 +1128,64 @@ class JobList extends Component {
|
|
|
1223
1128
|
});
|
|
1224
1129
|
});
|
|
1225
1130
|
this.state = {
|
|
1226
|
-
|
|
1131
|
+
showCompleted: false,
|
|
1132
|
+
sortColumn: "createdUnix",
|
|
1227
1133
|
sortDesc: true,
|
|
1228
1134
|
selectedTimeFilter: Analytics$2.getAnalyticsFilterOptions()[1],
|
|
1229
1135
|
assignees: [],
|
|
1230
|
-
requesters: []
|
|
1231
|
-
loading: false,
|
|
1232
|
-
loadingMore: false,
|
|
1233
|
-
lastKey: null,
|
|
1234
|
-
hasMore: true
|
|
1136
|
+
requesters: []
|
|
1235
1137
|
};
|
|
1236
1138
|
this.exportColumns = [{
|
|
1237
|
-
label:
|
|
1238
|
-
key:
|
|
1139
|
+
label: "Select All",
|
|
1140
|
+
key: ""
|
|
1239
1141
|
}, {
|
|
1240
|
-
label:
|
|
1241
|
-
key:
|
|
1142
|
+
label: "System Id",
|
|
1143
|
+
key: "id"
|
|
1242
1144
|
}, {
|
|
1243
1145
|
label: "".concat(values.textEntityName, " No."),
|
|
1244
|
-
key:
|
|
1146
|
+
key: "jobId"
|
|
1245
1147
|
}, {
|
|
1246
1148
|
label: values.textJobType,
|
|
1247
|
-
key:
|
|
1149
|
+
key: "type"
|
|
1248
1150
|
}, {
|
|
1249
|
-
label:
|
|
1250
|
-
key:
|
|
1151
|
+
label: "Status",
|
|
1152
|
+
key: "status"
|
|
1251
1153
|
}, {
|
|
1252
|
-
label:
|
|
1253
|
-
key:
|
|
1154
|
+
label: "Priority",
|
|
1155
|
+
key: "priority"
|
|
1254
1156
|
}, {
|
|
1255
|
-
label:
|
|
1256
|
-
key:
|
|
1157
|
+
label: "Title",
|
|
1158
|
+
key: "title"
|
|
1257
1159
|
}, {
|
|
1258
|
-
label:
|
|
1259
|
-
key:
|
|
1160
|
+
label: "Address",
|
|
1161
|
+
key: "room"
|
|
1260
1162
|
}, {
|
|
1261
|
-
label:
|
|
1262
|
-
key:
|
|
1163
|
+
label: "Description",
|
|
1164
|
+
key: "description"
|
|
1263
1165
|
}, {
|
|
1264
|
-
label:
|
|
1265
|
-
key:
|
|
1166
|
+
label: "Notes",
|
|
1167
|
+
key: "notes"
|
|
1266
1168
|
}, {
|
|
1267
|
-
label:
|
|
1268
|
-
key:
|
|
1169
|
+
label: "User Name",
|
|
1170
|
+
key: "userName"
|
|
1269
1171
|
}, {
|
|
1270
|
-
label:
|
|
1271
|
-
key:
|
|
1172
|
+
label: "User ID",
|
|
1173
|
+
key: "userID"
|
|
1272
1174
|
}, {
|
|
1273
|
-
label:
|
|
1274
|
-
key:
|
|
1175
|
+
label: "Request Time",
|
|
1176
|
+
key: "createdTime"
|
|
1275
1177
|
}, {
|
|
1276
|
-
label:
|
|
1277
|
-
key:
|
|
1178
|
+
label: "Progress Time",
|
|
1179
|
+
key: "progressTime"
|
|
1278
1180
|
}, {
|
|
1279
|
-
label:
|
|
1280
|
-
key:
|
|
1181
|
+
label: "Completed Time",
|
|
1182
|
+
key: "completedTime"
|
|
1281
1183
|
}, {
|
|
1282
|
-
label:
|
|
1283
|
-
key:
|
|
1184
|
+
label: "Time to Progress (in seconds)",
|
|
1185
|
+
key: "progressDuration"
|
|
1284
1186
|
}, {
|
|
1285
|
-
label:
|
|
1286
|
-
key:
|
|
1187
|
+
label: "Time to Complete (in seconds)",
|
|
1188
|
+
key: "completedDuration"
|
|
1287
1189
|
}];
|
|
1288
1190
|
}
|
|
1289
1191
|
UNSAFE_componentWillMount() {
|
|
@@ -1291,14 +1193,14 @@ class JobList extends Component {
|
|
|
1291
1193
|
}
|
|
1292
1194
|
componentDidMount() {
|
|
1293
1195
|
this.props.jobStatusesUpdate(this.props.auth.site);
|
|
1294
|
-
this.
|
|
1196
|
+
this.getJobs();
|
|
1295
1197
|
this.getAssignees();
|
|
1296
1198
|
}
|
|
1297
1199
|
renderFilterPopup() {
|
|
1298
1200
|
if (!this.state.filterOpen) {
|
|
1299
1201
|
return null;
|
|
1300
1202
|
}
|
|
1301
|
-
if (this.state.filterOpen ===
|
|
1203
|
+
if (this.state.filterOpen === "type") {
|
|
1302
1204
|
return /*#__PURE__*/jsx(Components$7.Popup, {
|
|
1303
1205
|
title: "Select ".concat(values.textJobType),
|
|
1304
1206
|
maxWidth: 600,
|
|
@@ -1316,7 +1218,7 @@ class JobList extends Component {
|
|
|
1316
1218
|
})
|
|
1317
1219
|
});
|
|
1318
1220
|
}
|
|
1319
|
-
if (this.state.filterOpen ===
|
|
1221
|
+
if (this.state.filterOpen === "priority") {
|
|
1320
1222
|
return /*#__PURE__*/jsx(Components$7.Popup, {
|
|
1321
1223
|
title: "Select Priority",
|
|
1322
1224
|
maxWidth: 600,
|
|
@@ -1334,7 +1236,7 @@ class JobList extends Component {
|
|
|
1334
1236
|
})
|
|
1335
1237
|
});
|
|
1336
1238
|
}
|
|
1337
|
-
if (this.state.filterOpen ===
|
|
1239
|
+
if (this.state.filterOpen === "status") {
|
|
1338
1240
|
var {
|
|
1339
1241
|
statusTypes
|
|
1340
1242
|
} = this.props;
|
|
@@ -1355,7 +1257,7 @@ class JobList extends Component {
|
|
|
1355
1257
|
})
|
|
1356
1258
|
});
|
|
1357
1259
|
}
|
|
1358
|
-
if (this.state.filterOpen ===
|
|
1260
|
+
if (this.state.filterOpen === "time") {
|
|
1359
1261
|
return /*#__PURE__*/jsx(Components$7.Popup, {
|
|
1360
1262
|
title: "Select Time",
|
|
1361
1263
|
maxWidth: 600,
|
|
@@ -1363,13 +1265,13 @@ class JobList extends Component {
|
|
|
1363
1265
|
hasPadding: true,
|
|
1364
1266
|
onClose: this.closeFilter,
|
|
1365
1267
|
buttons: [{
|
|
1366
|
-
type:
|
|
1268
|
+
type: "primaryAction",
|
|
1367
1269
|
onClick: this.saveTimeFilter,
|
|
1368
|
-
text:
|
|
1270
|
+
text: "Select",
|
|
1369
1271
|
isActive: this.isValidTimeFilter()
|
|
1370
1272
|
}],
|
|
1371
1273
|
children: /*#__PURE__*/jsx("div", {
|
|
1372
|
-
|
|
1274
|
+
iconStyle: {
|
|
1373
1275
|
minHeight: 150
|
|
1374
1276
|
},
|
|
1375
1277
|
children: /*#__PURE__*/jsx(Components$7.AnalyticsFilter, {
|
|
@@ -1380,19 +1282,19 @@ class JobList extends Component {
|
|
|
1380
1282
|
})
|
|
1381
1283
|
});
|
|
1382
1284
|
}
|
|
1383
|
-
if (this.state.filterOpen ===
|
|
1285
|
+
if (this.state.filterOpen === "user") {
|
|
1384
1286
|
var userContent = null;
|
|
1385
1287
|
if (this.state.selectedAssignee) {
|
|
1386
1288
|
userContent = /*#__PURE__*/jsx("div", {
|
|
1387
1289
|
children: /*#__PURE__*/jsx(Components$7.UserListing, {
|
|
1388
1290
|
user: this.state.selectedAssignee,
|
|
1389
|
-
rightContent: /*#__PURE__*/jsx(
|
|
1291
|
+
rightContent: /*#__PURE__*/jsx(Icon, {
|
|
1390
1292
|
className: "removeIcon",
|
|
1391
|
-
icon: "
|
|
1293
|
+
icon: "xmark",
|
|
1392
1294
|
onClick: () => {
|
|
1393
1295
|
this.onSelectAssignee();
|
|
1394
1296
|
},
|
|
1395
|
-
colour: Colours$
|
|
1297
|
+
colour: Colours$4.COLOUR_DUSK
|
|
1396
1298
|
})
|
|
1397
1299
|
}, this.state.selectedAssignee.id)
|
|
1398
1300
|
});
|
|
@@ -1427,27 +1329,27 @@ class JobList extends Component {
|
|
|
1427
1329
|
hasPadding: true,
|
|
1428
1330
|
onClose: this.closeFilter,
|
|
1429
1331
|
buttons: [{
|
|
1430
|
-
type:
|
|
1332
|
+
type: "primaryAction",
|
|
1431
1333
|
onClick: this.saveUserFilter,
|
|
1432
|
-
text:
|
|
1334
|
+
text: "Select",
|
|
1433
1335
|
isActive: true
|
|
1434
1336
|
}],
|
|
1435
1337
|
children: userContent
|
|
1436
1338
|
});
|
|
1437
1339
|
}
|
|
1438
|
-
if (this.state.filterOpen ===
|
|
1340
|
+
if (this.state.filterOpen === "requester") {
|
|
1439
1341
|
var _userContent = null;
|
|
1440
1342
|
if (this.state.selectedRequester) {
|
|
1441
1343
|
_userContent = /*#__PURE__*/jsx("div", {
|
|
1442
1344
|
children: /*#__PURE__*/jsx(Components$7.UserListing, {
|
|
1443
1345
|
user: this.state.selectedRequester,
|
|
1444
|
-
rightContent: /*#__PURE__*/jsx(
|
|
1346
|
+
rightContent: /*#__PURE__*/jsx(Icon, {
|
|
1445
1347
|
className: "removeIcon",
|
|
1446
|
-
icon: "
|
|
1348
|
+
icon: "xmark",
|
|
1447
1349
|
onClick: () => {
|
|
1448
1350
|
this.onSelectRequester();
|
|
1449
1351
|
},
|
|
1450
|
-
colour: Colours$
|
|
1352
|
+
colour: Colours$4.COLOUR_DUSK
|
|
1451
1353
|
})
|
|
1452
1354
|
}, this.state.selectedRequester.id)
|
|
1453
1355
|
});
|
|
@@ -1482,9 +1384,9 @@ class JobList extends Component {
|
|
|
1482
1384
|
hasPadding: true,
|
|
1483
1385
|
onClose: this.closeFilter,
|
|
1484
1386
|
buttons: [{
|
|
1485
|
-
type:
|
|
1387
|
+
type: "primaryAction",
|
|
1486
1388
|
onClick: this.saveRequesterFilter,
|
|
1487
|
-
text:
|
|
1389
|
+
text: "Select",
|
|
1488
1390
|
isActive: true
|
|
1489
1391
|
}],
|
|
1490
1392
|
children: _userContent
|
|
@@ -1517,7 +1419,7 @@ class JobList extends Component {
|
|
|
1517
1419
|
}), /*#__PURE__*/jsx("td", {
|
|
1518
1420
|
children: ev.type
|
|
1519
1421
|
}), /*#__PURE__*/jsx("td", {
|
|
1520
|
-
children: moment.utc(ev.createdTime).local().format(
|
|
1422
|
+
children: moment.utc(ev.createdTime).local().format("D MMM YY")
|
|
1521
1423
|
}), /*#__PURE__*/jsx("td", {
|
|
1522
1424
|
children: ev.room
|
|
1523
1425
|
}), /*#__PURE__*/jsx("td", {
|
|
@@ -1528,34 +1430,34 @@ class JobList extends Component {
|
|
|
1528
1430
|
profilePic: ev.userProfilePic
|
|
1529
1431
|
},
|
|
1530
1432
|
textClass: "fontSize-13"
|
|
1531
|
-
}) :
|
|
1433
|
+
}) : "Unknown"
|
|
1532
1434
|
}), /*#__PURE__*/jsx("td", {
|
|
1533
1435
|
children: ev.Assignee ? /*#__PURE__*/jsx(Components$7.UserListing, {
|
|
1534
1436
|
user: ev.Assignee,
|
|
1535
1437
|
textClass: "fontSize-13"
|
|
1536
|
-
}) :
|
|
1438
|
+
}) : "Unassigned"
|
|
1537
1439
|
}), /*#__PURE__*/jsx("td", {
|
|
1538
1440
|
children: /*#__PURE__*/jsx("div", {
|
|
1539
1441
|
style: {
|
|
1540
|
-
textAlign:
|
|
1442
|
+
textAlign: "center",
|
|
1541
1443
|
borderRadius: 4,
|
|
1542
1444
|
width: 100,
|
|
1543
1445
|
paddingTop: 2,
|
|
1544
1446
|
paddingBottom: 2,
|
|
1545
|
-
color:
|
|
1447
|
+
color: "#fff",
|
|
1546
1448
|
backgroundColor: status ? status.color : undefined
|
|
1547
1449
|
},
|
|
1548
|
-
children: status ? status.text :
|
|
1450
|
+
children: status ? status.text : ""
|
|
1549
1451
|
})
|
|
1550
1452
|
}), /*#__PURE__*/jsx("td", {
|
|
1551
1453
|
children: /*#__PURE__*/jsx("div", {
|
|
1552
1454
|
style: {
|
|
1553
|
-
textAlign:
|
|
1455
|
+
textAlign: "center",
|
|
1554
1456
|
borderRadius: 4,
|
|
1555
1457
|
width: 100,
|
|
1556
1458
|
paddingTop: 2,
|
|
1557
1459
|
paddingBottom: 2,
|
|
1558
|
-
color:
|
|
1460
|
+
color: "#fff",
|
|
1559
1461
|
backgroundColor: priority.color
|
|
1560
1462
|
},
|
|
1561
1463
|
children: priority.name
|
|
@@ -1563,30 +1465,30 @@ class JobList extends Component {
|
|
|
1563
1465
|
}), /*#__PURE__*/jsx("td", {
|
|
1564
1466
|
className: "table-options",
|
|
1565
1467
|
children: /*#__PURE__*/jsxs("div", {
|
|
1566
|
-
|
|
1567
|
-
display:
|
|
1568
|
-
alignItems:
|
|
1468
|
+
iconStyle: {
|
|
1469
|
+
display: "flex",
|
|
1470
|
+
alignItems: "center"
|
|
1569
1471
|
},
|
|
1570
1472
|
children: [/*#__PURE__*/jsx(Link, {
|
|
1571
1473
|
to: "".concat(values.routeRequestDetails, "/").concat(ev.id),
|
|
1572
|
-
children: /*#__PURE__*/jsx(
|
|
1474
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
1573
1475
|
style: {
|
|
1574
1476
|
fontSize: 20,
|
|
1575
1477
|
padding: 5,
|
|
1576
|
-
cursor:
|
|
1478
|
+
cursor: "pointer"
|
|
1577
1479
|
},
|
|
1578
|
-
|
|
1480
|
+
icon: "pencil"
|
|
1579
1481
|
})
|
|
1580
1482
|
}), Session$7.validateAccess(this.props.auth.site, values.permissionMaintenanceTracking, this.props.auth) && /*#__PURE__*/jsx("a", {
|
|
1581
1483
|
onClick: () => this.onRemoveRequest(ev),
|
|
1582
|
-
children: /*#__PURE__*/jsx(
|
|
1484
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
1583
1485
|
style: {
|
|
1584
1486
|
fontSize: 20,
|
|
1585
1487
|
padding: 5,
|
|
1586
1488
|
marginLeft: 8,
|
|
1587
|
-
cursor:
|
|
1489
|
+
cursor: "pointer"
|
|
1588
1490
|
},
|
|
1589
|
-
|
|
1491
|
+
icon: "circle-minus"
|
|
1590
1492
|
})
|
|
1591
1493
|
})]
|
|
1592
1494
|
})
|
|
@@ -1600,26 +1502,26 @@ class JobList extends Component {
|
|
|
1600
1502
|
sortDesc
|
|
1601
1503
|
} = this.state;
|
|
1602
1504
|
if (col !== sortColumn) return null;
|
|
1603
|
-
return /*#__PURE__*/jsx(
|
|
1505
|
+
return /*#__PURE__*/jsx(Icon, {
|
|
1604
1506
|
style: {
|
|
1605
1507
|
marginLeft: 5
|
|
1606
1508
|
},
|
|
1607
|
-
|
|
1509
|
+
icon: sortDesc ? "fa-".concat("chevron-up") : "fa-".concat("chevron-down")
|
|
1608
1510
|
});
|
|
1609
1511
|
}
|
|
1610
1512
|
sortIsActive(col) {
|
|
1611
|
-
if (col !== this.state.sortColumn) return
|
|
1612
|
-
return
|
|
1513
|
+
if (col !== this.state.sortColumn) return "";
|
|
1514
|
+
return " table--columnActive";
|
|
1613
1515
|
}
|
|
1614
1516
|
renderEmpty() {
|
|
1615
1517
|
var title = this.props.strings["".concat(values.featureKey, "_textTitleRequests")] || values.textTitleRequests;
|
|
1616
1518
|
return /*#__PURE__*/jsxs("div", {
|
|
1617
1519
|
style: {
|
|
1618
|
-
display:
|
|
1619
|
-
flexDirection:
|
|
1520
|
+
display: "flex",
|
|
1521
|
+
flexDirection: "column",
|
|
1620
1522
|
flex: 1,
|
|
1621
|
-
justifyContent:
|
|
1622
|
-
alignItems:
|
|
1523
|
+
justifyContent: "center",
|
|
1524
|
+
alignItems: "center",
|
|
1623
1525
|
marginTop: 32
|
|
1624
1526
|
},
|
|
1625
1527
|
children: [/*#__PURE__*/jsx("div", {
|
|
@@ -1628,7 +1530,7 @@ class JobList extends Component {
|
|
|
1628
1530
|
className: "marginTop-32",
|
|
1629
1531
|
style: {
|
|
1630
1532
|
maxWidth: 500,
|
|
1631
|
-
textAlign:
|
|
1533
|
+
textAlign: "center"
|
|
1632
1534
|
},
|
|
1633
1535
|
children: /*#__PURE__*/jsxs("span", {
|
|
1634
1536
|
className: "fontRegular fontSize-13",
|
|
@@ -1641,149 +1543,112 @@ class JobList extends Component {
|
|
|
1641
1543
|
className: "marginTop-8 fontRegular fontSize-13",
|
|
1642
1544
|
style: {
|
|
1643
1545
|
maxWidth: 500,
|
|
1644
|
-
textAlign:
|
|
1546
|
+
textAlign: "center"
|
|
1645
1547
|
},
|
|
1646
1548
|
children: values.textEmptyExample
|
|
1647
1549
|
})]
|
|
1648
1550
|
});
|
|
1649
1551
|
}
|
|
1650
1552
|
renderContent() {
|
|
1651
|
-
if (this.state.loading) {
|
|
1652
|
-
return /*#__PURE__*/jsx("div", {
|
|
1653
|
-
style: {
|
|
1654
|
-
display: 'flex',
|
|
1655
|
-
justifyContent: 'center',
|
|
1656
|
-
padding: 40
|
|
1657
|
-
},
|
|
1658
|
-
children: /*#__PURE__*/jsx(FontAwesome, {
|
|
1659
|
-
style: {
|
|
1660
|
-
fontSize: 32,
|
|
1661
|
-
color: '#ccc'
|
|
1662
|
-
},
|
|
1663
|
-
name: "spinner fa-pulse fa-fw"
|
|
1664
|
-
})
|
|
1665
|
-
});
|
|
1666
|
-
}
|
|
1667
1553
|
if (_.isEmpty(this.props.source)) return this.renderEmpty();
|
|
1668
|
-
return /*#__PURE__*/jsxs(
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
children:
|
|
1679
|
-
children: /*#__PURE__*/jsxs("
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
})]
|
|
1764
|
-
})
|
|
1765
|
-
}), /*#__PURE__*/jsx("tbody", {
|
|
1766
|
-
children: this.renderRequests()
|
|
1767
|
-
})]
|
|
1768
|
-
}), this.state.hasMore && /*#__PURE__*/jsx("div", {
|
|
1769
|
-
style: {
|
|
1770
|
-
display: 'flex',
|
|
1771
|
-
justifyContent: 'center',
|
|
1772
|
-
padding: '16px 0'
|
|
1773
|
-
},
|
|
1774
|
-
children: this.state.loadingMore ? /*#__PURE__*/jsx(FontAwesome, {
|
|
1775
|
-
style: {
|
|
1776
|
-
fontSize: 24,
|
|
1777
|
-
color: '#ccc'
|
|
1778
|
-
},
|
|
1779
|
-
name: "spinner fa-pulse fa-fw"
|
|
1780
|
-
}) : /*#__PURE__*/jsx(Components$7.Button, {
|
|
1781
|
-
inline: true,
|
|
1782
|
-
buttonType: "tertiary",
|
|
1783
|
-
onClick: this.loadMore,
|
|
1784
|
-
isActive: true,
|
|
1785
|
-
children: "Load More"
|
|
1554
|
+
return /*#__PURE__*/jsxs(Table, {
|
|
1555
|
+
className: "plussTable",
|
|
1556
|
+
striped: true,
|
|
1557
|
+
bordered: true,
|
|
1558
|
+
condensed: true,
|
|
1559
|
+
hover: true,
|
|
1560
|
+
style: {
|
|
1561
|
+
minWidth: "100%"
|
|
1562
|
+
},
|
|
1563
|
+
children: [/*#__PURE__*/jsx("thead", {
|
|
1564
|
+
children: /*#__PURE__*/jsxs("tr", {
|
|
1565
|
+
children: [/*#__PURE__*/jsxs("th", {
|
|
1566
|
+
className: "".concat(this.sortIsActive("jobId")),
|
|
1567
|
+
style: {
|
|
1568
|
+
cursor: "pointer",
|
|
1569
|
+
width: 70
|
|
1570
|
+
},
|
|
1571
|
+
onClick: () => {
|
|
1572
|
+
this.sortByCol("jobId");
|
|
1573
|
+
},
|
|
1574
|
+
children: [values.textEntityName, " No.", this.renderSort("jobId")]
|
|
1575
|
+
}), /*#__PURE__*/jsxs("th", {
|
|
1576
|
+
className: "".concat(this.sortIsActive("title")),
|
|
1577
|
+
style: {
|
|
1578
|
+
cursor: "pointer"
|
|
1579
|
+
},
|
|
1580
|
+
onClick: () => {
|
|
1581
|
+
this.sortByCol("title");
|
|
1582
|
+
},
|
|
1583
|
+
children: ["Title", this.renderSort("title")]
|
|
1584
|
+
}), /*#__PURE__*/jsxs("th", {
|
|
1585
|
+
className: "".concat(this.sortIsActive("type")),
|
|
1586
|
+
style: {
|
|
1587
|
+
cursor: "pointer",
|
|
1588
|
+
width: 100
|
|
1589
|
+
},
|
|
1590
|
+
onClick: () => {
|
|
1591
|
+
this.sortByCol("type");
|
|
1592
|
+
},
|
|
1593
|
+
children: [values.textJobType, this.renderSort("type")]
|
|
1594
|
+
}), /*#__PURE__*/jsxs("th", {
|
|
1595
|
+
className: "".concat(this.sortIsActive("createdUnix")),
|
|
1596
|
+
style: {
|
|
1597
|
+
cursor: "pointer",
|
|
1598
|
+
width: 80
|
|
1599
|
+
},
|
|
1600
|
+
onClick: () => {
|
|
1601
|
+
this.sortByCol("createdUnix");
|
|
1602
|
+
},
|
|
1603
|
+
children: ["Date", this.renderSort("createdUnix")]
|
|
1604
|
+
}), /*#__PURE__*/jsxs("th", {
|
|
1605
|
+
className: "".concat(this.sortIsActive("room")),
|
|
1606
|
+
style: {
|
|
1607
|
+
cursor: "pointer",
|
|
1608
|
+
width: 100
|
|
1609
|
+
},
|
|
1610
|
+
onClick: () => {
|
|
1611
|
+
this.sortByCol("room");
|
|
1612
|
+
},
|
|
1613
|
+
children: ["Address", this.renderSort("room")]
|
|
1614
|
+
}), /*#__PURE__*/jsxs("th", {
|
|
1615
|
+
className: "".concat(this.sortIsActive("userName")),
|
|
1616
|
+
style: {
|
|
1617
|
+
cursor: "pointer",
|
|
1618
|
+
width: 150
|
|
1619
|
+
},
|
|
1620
|
+
onClick: () => {
|
|
1621
|
+
this.sortByCol("userName");
|
|
1622
|
+
},
|
|
1623
|
+
children: ["Submitted By", this.renderSort("userName")]
|
|
1624
|
+
}), /*#__PURE__*/jsxs("th", {
|
|
1625
|
+
className: "".concat(this.sortIsActive("assigned")),
|
|
1626
|
+
style: {
|
|
1627
|
+
cursor: "pointer",
|
|
1628
|
+
width: 150
|
|
1629
|
+
},
|
|
1630
|
+
onClick: () => {
|
|
1631
|
+
this.sortByCol("assigned");
|
|
1632
|
+
},
|
|
1633
|
+
children: ["Assigned To", this.renderSort("assigned")]
|
|
1634
|
+
}), /*#__PURE__*/jsx("th", {
|
|
1635
|
+
iconStyle: {
|
|
1636
|
+
width: 120
|
|
1637
|
+
},
|
|
1638
|
+
children: "Status"
|
|
1639
|
+
}), /*#__PURE__*/jsx("th", {
|
|
1640
|
+
iconStyle: {
|
|
1641
|
+
width: 120
|
|
1642
|
+
},
|
|
1643
|
+
children: "Priority"
|
|
1644
|
+
}), /*#__PURE__*/jsx("th", {
|
|
1645
|
+
iconStyle: {
|
|
1646
|
+
width: 50
|
|
1647
|
+
}
|
|
1648
|
+
})]
|
|
1786
1649
|
})
|
|
1650
|
+
}), /*#__PURE__*/jsx("tbody", {
|
|
1651
|
+
children: this.renderRequests()
|
|
1787
1652
|
})]
|
|
1788
1653
|
});
|
|
1789
1654
|
}
|
|
@@ -1791,42 +1656,42 @@ class JobList extends Component {
|
|
|
1791
1656
|
var typeFilter = /*#__PURE__*/jsx(Components$7.Tag, {
|
|
1792
1657
|
className: "marginRight-10",
|
|
1793
1658
|
onClick: () => {
|
|
1794
|
-
this.openFilter(
|
|
1659
|
+
this.openFilter("type");
|
|
1795
1660
|
},
|
|
1796
1661
|
text: values.textJobType
|
|
1797
1662
|
});
|
|
1798
1663
|
var statusFilter = /*#__PURE__*/jsx(Components$7.Tag, {
|
|
1799
1664
|
className: "marginRight-10",
|
|
1800
1665
|
onClick: () => {
|
|
1801
|
-
this.openFilter(
|
|
1666
|
+
this.openFilter("status");
|
|
1802
1667
|
},
|
|
1803
1668
|
text: "Status"
|
|
1804
1669
|
});
|
|
1805
1670
|
var priorityFilter = /*#__PURE__*/jsx(Components$7.Tag, {
|
|
1806
1671
|
className: "marginRight-10",
|
|
1807
1672
|
onClick: () => {
|
|
1808
|
-
this.openFilter(
|
|
1673
|
+
this.openFilter("priority");
|
|
1809
1674
|
},
|
|
1810
1675
|
text: "Priority"
|
|
1811
1676
|
});
|
|
1812
1677
|
var timeFilter = /*#__PURE__*/jsx(Components$7.Tag, {
|
|
1813
1678
|
className: "marginRight-10",
|
|
1814
1679
|
onClick: () => {
|
|
1815
|
-
this.openFilter(
|
|
1680
|
+
this.openFilter("time");
|
|
1816
1681
|
},
|
|
1817
1682
|
text: "Time"
|
|
1818
1683
|
});
|
|
1819
1684
|
var userFilter = /*#__PURE__*/jsx(Components$7.Tag, {
|
|
1820
1685
|
className: "marginRight-10",
|
|
1821
1686
|
onClick: () => {
|
|
1822
|
-
this.openFilter(
|
|
1687
|
+
this.openFilter("user");
|
|
1823
1688
|
},
|
|
1824
1689
|
text: "Assigned To"
|
|
1825
1690
|
});
|
|
1826
1691
|
var requesterFilter = /*#__PURE__*/jsx(Components$7.Tag, {
|
|
1827
1692
|
className: "marginRight-10",
|
|
1828
1693
|
onClick: () => {
|
|
1829
|
-
this.openFilter(
|
|
1694
|
+
this.openFilter("requester");
|
|
1830
1695
|
},
|
|
1831
1696
|
text: "Submitted By"
|
|
1832
1697
|
});
|
|
@@ -1834,7 +1699,7 @@ class JobList extends Component {
|
|
|
1834
1699
|
typeFilter = /*#__PURE__*/jsx(Components$7.Tag, {
|
|
1835
1700
|
className: "marginRight-10",
|
|
1836
1701
|
onClick: () => {
|
|
1837
|
-
this.openFilter(
|
|
1702
|
+
this.openFilter("type");
|
|
1838
1703
|
},
|
|
1839
1704
|
rightIcon: "close",
|
|
1840
1705
|
rightClick: e => {
|
|
@@ -1848,7 +1713,7 @@ class JobList extends Component {
|
|
|
1848
1713
|
priorityFilter = /*#__PURE__*/jsx(Components$7.Tag, {
|
|
1849
1714
|
className: "marginRight-10",
|
|
1850
1715
|
onClick: () => {
|
|
1851
|
-
this.openFilter(
|
|
1716
|
+
this.openFilter("priority");
|
|
1852
1717
|
},
|
|
1853
1718
|
rightIcon: "close",
|
|
1854
1719
|
rightClick: e => {
|
|
@@ -1862,7 +1727,7 @@ class JobList extends Component {
|
|
|
1862
1727
|
statusFilter = /*#__PURE__*/jsx(Components$7.Tag, {
|
|
1863
1728
|
className: "marginRight-10",
|
|
1864
1729
|
onClick: () => {
|
|
1865
|
-
this.openFilter(
|
|
1730
|
+
this.openFilter("status");
|
|
1866
1731
|
},
|
|
1867
1732
|
rightIcon: "close",
|
|
1868
1733
|
rightClick: e => {
|
|
@@ -1876,7 +1741,7 @@ class JobList extends Component {
|
|
|
1876
1741
|
timeFilter = /*#__PURE__*/jsx(Components$7.Tag, {
|
|
1877
1742
|
className: "marginRight-10",
|
|
1878
1743
|
onClick: () => {
|
|
1879
|
-
this.openFilter(
|
|
1744
|
+
this.openFilter("time");
|
|
1880
1745
|
},
|
|
1881
1746
|
rightIcon: "close",
|
|
1882
1747
|
rightClick: e => {
|
|
@@ -1890,7 +1755,7 @@ class JobList extends Component {
|
|
|
1890
1755
|
userFilter = /*#__PURE__*/jsx(Components$7.Tag, {
|
|
1891
1756
|
className: "marginRight-10",
|
|
1892
1757
|
onClick: () => {
|
|
1893
|
-
this.openFilter(
|
|
1758
|
+
this.openFilter("user");
|
|
1894
1759
|
},
|
|
1895
1760
|
rightIcon: "close",
|
|
1896
1761
|
rightClick: e => {
|
|
@@ -1904,7 +1769,7 @@ class JobList extends Component {
|
|
|
1904
1769
|
requesterFilter = /*#__PURE__*/jsx(Components$7.Tag, {
|
|
1905
1770
|
className: "marginRight-10",
|
|
1906
1771
|
onClick: () => {
|
|
1907
|
-
this.openFilter(
|
|
1772
|
+
this.openFilter("requester");
|
|
1908
1773
|
},
|
|
1909
1774
|
rightIcon: "close",
|
|
1910
1775
|
rightClick: e => {
|
|
@@ -1927,7 +1792,7 @@ class JobList extends Component {
|
|
|
1927
1792
|
}), /*#__PURE__*/jsx(Components$7.Button, {
|
|
1928
1793
|
inline: true,
|
|
1929
1794
|
buttonType: "primaryAction",
|
|
1930
|
-
leftIcon: "file-code
|
|
1795
|
+
leftIcon: "file-code",
|
|
1931
1796
|
onClick: this.onOpenExportCsv,
|
|
1932
1797
|
isActive: !_.isEmpty(this.getSource()),
|
|
1933
1798
|
children: "Export CSV"
|
|
@@ -1962,8 +1827,8 @@ class JobList extends Component {
|
|
|
1962
1827
|
}
|
|
1963
1828
|
render() {
|
|
1964
1829
|
return /*#__PURE__*/jsxs("div", {
|
|
1965
|
-
|
|
1966
|
-
minWidth:
|
|
1830
|
+
iconStyle: {
|
|
1831
|
+
minWidth: "100%"
|
|
1967
1832
|
},
|
|
1968
1833
|
children: [this.renderFilterPopup(), this.renderCSVPopup(), this.renderFilters(), this.renderContent()]
|
|
1969
1834
|
});
|
|
@@ -1982,7 +1847,6 @@ var mapStateToProps$7 = state => {
|
|
|
1982
1847
|
};
|
|
1983
1848
|
var JobList$1 = connect(mapStateToProps$7, {
|
|
1984
1849
|
jobsLoaded,
|
|
1985
|
-
jobsAdded,
|
|
1986
1850
|
removeJob,
|
|
1987
1851
|
jobStatusesUpdate
|
|
1988
1852
|
})(withRouter(JobList));
|
|
@@ -2001,7 +1865,7 @@ class JobTypes extends Component {
|
|
|
2001
1865
|
var res = yield maintenanceActions.getJobTypes(_this.props.auth.site);
|
|
2002
1866
|
if (res.data != null) _this.props.jobTypesLoaded(res.data);
|
|
2003
1867
|
} catch (error) {
|
|
2004
|
-
console.error(
|
|
1868
|
+
console.error("getJobTypes", error);
|
|
2005
1869
|
} finally {
|
|
2006
1870
|
_this.setState({
|
|
2007
1871
|
loading: false
|
|
@@ -2034,8 +1898,8 @@ class JobTypes extends Component {
|
|
|
2034
1898
|
_this.props.jobTypesLoaded(newJobTypes);
|
|
2035
1899
|
}
|
|
2036
1900
|
} catch (error) {
|
|
2037
|
-
console.error(
|
|
2038
|
-
alert(
|
|
1901
|
+
console.error("onRemoveJobType", error);
|
|
1902
|
+
alert("Something went wrong with the request. Please try again.");
|
|
2039
1903
|
}
|
|
2040
1904
|
});
|
|
2041
1905
|
return function (_x) {
|
|
@@ -2044,7 +1908,7 @@ class JobTypes extends Component {
|
|
|
2044
1908
|
}());
|
|
2045
1909
|
this.state = {
|
|
2046
1910
|
jobList: [],
|
|
2047
|
-
sortColumn:
|
|
1911
|
+
sortColumn: "name",
|
|
2048
1912
|
sortDesc: false,
|
|
2049
1913
|
loading: true
|
|
2050
1914
|
};
|
|
@@ -2088,31 +1952,31 @@ class JobTypes extends Component {
|
|
|
2088
1952
|
}), /*#__PURE__*/jsx("td", {
|
|
2089
1953
|
className: "table-options",
|
|
2090
1954
|
children: /*#__PURE__*/jsxs("div", {
|
|
2091
|
-
|
|
2092
|
-
display:
|
|
2093
|
-
alignItems:
|
|
1955
|
+
iconStyle: {
|
|
1956
|
+
display: "flex",
|
|
1957
|
+
alignItems: "center"
|
|
2094
1958
|
},
|
|
2095
1959
|
children: [Session$6.validateAccess(this.props.auth.site, values.permissionMaintenanceTypes, this.props.auth) && /*#__PURE__*/jsx(Link, {
|
|
2096
1960
|
to: "".concat(values.routeAddRequestType, "/").concat(ev.id),
|
|
2097
|
-
children: /*#__PURE__*/jsx(
|
|
1961
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
2098
1962
|
style: {
|
|
2099
1963
|
fontSize: 20,
|
|
2100
1964
|
padding: 5,
|
|
2101
1965
|
marginLeft: 12,
|
|
2102
|
-
cursor:
|
|
1966
|
+
cursor: "pointer"
|
|
2103
1967
|
},
|
|
2104
|
-
|
|
1968
|
+
icon: "pencil"
|
|
2105
1969
|
})
|
|
2106
1970
|
}), Session$6.validateAccess(this.props.auth.site, values.permissionMaintenanceTypes, this.props.auth) && /*#__PURE__*/jsx("a", {
|
|
2107
1971
|
onClick: () => this.onRemoveJobType(ev),
|
|
2108
|
-
children: /*#__PURE__*/jsx(
|
|
1972
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
2109
1973
|
style: {
|
|
2110
1974
|
fontSize: 20,
|
|
2111
1975
|
padding: 5,
|
|
2112
1976
|
marginLeft: 8,
|
|
2113
|
-
cursor:
|
|
1977
|
+
cursor: "pointer"
|
|
2114
1978
|
},
|
|
2115
|
-
|
|
1979
|
+
icon: "circle-minus"
|
|
2116
1980
|
})
|
|
2117
1981
|
})]
|
|
2118
1982
|
})
|
|
@@ -2130,30 +1994,30 @@ class JobTypes extends Component {
|
|
|
2130
1994
|
condensed: true,
|
|
2131
1995
|
hover: true,
|
|
2132
1996
|
style: {
|
|
2133
|
-
minWidth:
|
|
1997
|
+
minWidth: "100%"
|
|
2134
1998
|
},
|
|
2135
1999
|
children: [/*#__PURE__*/jsx("thead", {
|
|
2136
2000
|
children: /*#__PURE__*/jsxs("tr", {
|
|
2137
2001
|
children: [/*#__PURE__*/jsxs("th", {
|
|
2138
2002
|
style: {
|
|
2139
|
-
cursor:
|
|
2003
|
+
cursor: "pointer"
|
|
2140
2004
|
},
|
|
2141
|
-
onClick: () => this.sortByCol(
|
|
2005
|
+
onClick: () => this.sortByCol("name"),
|
|
2142
2006
|
children: [values.textSingularName, " type"]
|
|
2143
2007
|
}), /*#__PURE__*/jsx("th", {
|
|
2144
2008
|
style: {
|
|
2145
|
-
cursor:
|
|
2009
|
+
cursor: "pointer"
|
|
2146
2010
|
},
|
|
2147
|
-
onClick: () => this.sortByCol(
|
|
2011
|
+
onClick: () => this.sortByCol("name"),
|
|
2148
2012
|
children: "Type Description"
|
|
2149
2013
|
}), /*#__PURE__*/jsx("th", {
|
|
2150
2014
|
style: {
|
|
2151
|
-
cursor:
|
|
2015
|
+
cursor: "pointer"
|
|
2152
2016
|
},
|
|
2153
|
-
onClick: () => this.sortByCol(
|
|
2017
|
+
onClick: () => this.sortByCol("email"),
|
|
2154
2018
|
children: "Email"
|
|
2155
2019
|
}), /*#__PURE__*/jsx("th", {
|
|
2156
|
-
|
|
2020
|
+
iconStyle: {
|
|
2157
2021
|
width: 70
|
|
2158
2022
|
}
|
|
2159
2023
|
})]
|
|
@@ -2166,11 +2030,11 @@ class JobTypes extends Component {
|
|
|
2166
2030
|
renderEmpty() {
|
|
2167
2031
|
return /*#__PURE__*/jsxs("div", {
|
|
2168
2032
|
style: {
|
|
2169
|
-
display:
|
|
2170
|
-
flexDirection:
|
|
2033
|
+
display: "flex",
|
|
2034
|
+
flexDirection: "column",
|
|
2171
2035
|
flex: 1,
|
|
2172
|
-
justifyContent:
|
|
2173
|
-
alignItems:
|
|
2036
|
+
justifyContent: "center",
|
|
2037
|
+
alignItems: "center",
|
|
2174
2038
|
marginTop: 32
|
|
2175
2039
|
},
|
|
2176
2040
|
children: [/*#__PURE__*/jsx("div", {
|
|
@@ -2179,7 +2043,7 @@ class JobTypes extends Component {
|
|
|
2179
2043
|
className: "marginTop-32",
|
|
2180
2044
|
style: {
|
|
2181
2045
|
maxWidth: 500,
|
|
2182
|
-
textAlign:
|
|
2046
|
+
textAlign: "center"
|
|
2183
2047
|
},
|
|
2184
2048
|
children: /*#__PURE__*/jsx("span", {
|
|
2185
2049
|
className: "fontRegular fontSize-13",
|
|
@@ -2189,7 +2053,7 @@ class JobTypes extends Component {
|
|
|
2189
2053
|
className: "marginTop-8 fontRegular fontSize-13",
|
|
2190
2054
|
style: {
|
|
2191
2055
|
maxWidth: 500,
|
|
2192
|
-
textAlign:
|
|
2056
|
+
textAlign: "center"
|
|
2193
2057
|
},
|
|
2194
2058
|
children: values.textEmptyJobTypesExample
|
|
2195
2059
|
})]
|
|
@@ -2206,27 +2070,29 @@ class JobTypes extends Component {
|
|
|
2206
2070
|
} = this.state;
|
|
2207
2071
|
if (jobList.length === 0 && loading) {
|
|
2208
2072
|
return /*#__PURE__*/jsx("div", {
|
|
2209
|
-
|
|
2210
|
-
minWidth:
|
|
2073
|
+
iconStyle: {
|
|
2074
|
+
minWidth: "100%"
|
|
2211
2075
|
},
|
|
2212
2076
|
children: /*#__PURE__*/jsx("div", {
|
|
2213
2077
|
className: "padding-60 paddingVertical-40",
|
|
2214
2078
|
style: {
|
|
2215
|
-
textAlign:
|
|
2079
|
+
textAlign: "center"
|
|
2216
2080
|
},
|
|
2217
|
-
children: /*#__PURE__*/jsx(
|
|
2218
|
-
|
|
2081
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
2082
|
+
iconStyle: {
|
|
2219
2083
|
fontSize: 30,
|
|
2220
2084
|
color: FeatureConfig.env.colourBrandingOff
|
|
2221
2085
|
},
|
|
2222
|
-
|
|
2086
|
+
icon: "spinner",
|
|
2087
|
+
pulse: true,
|
|
2088
|
+
fixedWidth: true
|
|
2223
2089
|
})
|
|
2224
2090
|
})
|
|
2225
2091
|
});
|
|
2226
2092
|
}
|
|
2227
2093
|
return /*#__PURE__*/jsxs("div", {
|
|
2228
|
-
|
|
2229
|
-
minWidth:
|
|
2094
|
+
iconStyle: {
|
|
2095
|
+
minWidth: "100%"
|
|
2230
2096
|
},
|
|
2231
2097
|
children: [/*#__PURE__*/jsx("div", {
|
|
2232
2098
|
className: "marginBottom-32",
|
|
@@ -2239,8 +2105,8 @@ class JobTypes extends Component {
|
|
|
2239
2105
|
}
|
|
2240
2106
|
render() {
|
|
2241
2107
|
return /*#__PURE__*/jsxs("div", {
|
|
2242
|
-
|
|
2243
|
-
minWidth:
|
|
2108
|
+
iconStyle: {
|
|
2109
|
+
minWidth: "100%"
|
|
2244
2110
|
},
|
|
2245
2111
|
children: [/*#__PURE__*/jsx("div", {
|
|
2246
2112
|
children: this.renderJobTypes()
|
|
@@ -2264,12 +2130,12 @@ var JobTypes$1 = connect(mapStateToProps$6, {
|
|
|
2264
2130
|
jobTypesUpdate
|
|
2265
2131
|
})(withRouter(JobTypes));
|
|
2266
2132
|
|
|
2267
|
-
function ownKeys$
|
|
2268
|
-
function _objectSpread$
|
|
2133
|
+
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; }
|
|
2134
|
+
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; }
|
|
2269
2135
|
var {
|
|
2270
2136
|
Session: Session$5,
|
|
2271
2137
|
Components: Components$5,
|
|
2272
|
-
Colours: Colours$
|
|
2138
|
+
Colours: Colours$3
|
|
2273
2139
|
} = PlussCore;
|
|
2274
2140
|
class Configuration extends Component {
|
|
2275
2141
|
constructor(props) {
|
|
@@ -2325,7 +2191,7 @@ class Configuration extends Component {
|
|
|
2325
2191
|
showWarnings: false,
|
|
2326
2192
|
showStatusPopup: true,
|
|
2327
2193
|
selectedStatusIndex: -1,
|
|
2328
|
-
statusLabel:
|
|
2194
|
+
statusLabel: "",
|
|
2329
2195
|
statusCategory: STATUS_NOT_ACTIONED,
|
|
2330
2196
|
statusColour: defaultStatus.color
|
|
2331
2197
|
});
|
|
@@ -2364,7 +2230,7 @@ class Configuration extends Component {
|
|
|
2364
2230
|
});
|
|
2365
2231
|
_defineProperty(this, "onHandleChange", event => {
|
|
2366
2232
|
var stateChange = {};
|
|
2367
|
-
stateChange[event.target.getAttribute(
|
|
2233
|
+
stateChange[event.target.getAttribute("id")] = event.target.value;
|
|
2368
2234
|
this.setState(stateChange);
|
|
2369
2235
|
});
|
|
2370
2236
|
_defineProperty(this, "onToggleDisableSeen", () => {
|
|
@@ -2392,7 +2258,7 @@ class Configuration extends Component {
|
|
|
2392
2258
|
success: true
|
|
2393
2259
|
});
|
|
2394
2260
|
} catch (error) {
|
|
2395
|
-
console.log(
|
|
2261
|
+
console.log("onSaveConfig - error", error);
|
|
2396
2262
|
_this.setState({
|
|
2397
2263
|
success: false
|
|
2398
2264
|
});
|
|
@@ -2408,9 +2274,9 @@ class Configuration extends Component {
|
|
|
2408
2274
|
submitting: false,
|
|
2409
2275
|
selectedStatusIndex: -1,
|
|
2410
2276
|
showStatusPopup: false,
|
|
2411
|
-
statusLabel:
|
|
2277
|
+
statusLabel: "",
|
|
2412
2278
|
statusCategory: STATUS_NOT_ACTIONED,
|
|
2413
|
-
statusColour:
|
|
2279
|
+
statusColour: "",
|
|
2414
2280
|
fetchingStatusTypes: true,
|
|
2415
2281
|
statusTypes: this.props.statusTypes,
|
|
2416
2282
|
fetchingHideSeen: true,
|
|
@@ -2421,8 +2287,8 @@ class Configuration extends Component {
|
|
|
2421
2287
|
Session$5.checkLoggedIn(this);
|
|
2422
2288
|
}
|
|
2423
2289
|
componentDidMount() {
|
|
2424
|
-
if (!Session$5.validateAccess(this.props.auth.site,
|
|
2425
|
-
this.props.history.push(
|
|
2290
|
+
if (!Session$5.validateAccess(this.props.auth.site, "featurePicker", this.props.auth, true)) {
|
|
2291
|
+
this.props.history.push("/mastermenu");
|
|
2426
2292
|
} else {
|
|
2427
2293
|
this.props.jobStatusesUpdate(this.props.auth.site, statusTypes => this.setState({
|
|
2428
2294
|
statusTypes,
|
|
@@ -2472,7 +2338,7 @@ class Configuration extends Component {
|
|
|
2472
2338
|
style: styles$6.statusTypeContainer,
|
|
2473
2339
|
children: [/*#__PURE__*/jsx("div", {
|
|
2474
2340
|
className: "statusLabel",
|
|
2475
|
-
style: _objectSpread$
|
|
2341
|
+
style: _objectSpread$6(_objectSpread$6({}, styles$6.statusTextContainer), {}, {
|
|
2476
2342
|
backgroundColor: status.color
|
|
2477
2343
|
}),
|
|
2478
2344
|
children: /*#__PURE__*/jsx("span", {
|
|
@@ -2485,39 +2351,39 @@ class Configuration extends Component {
|
|
|
2485
2351
|
className: "fontMedium fontSize-16 text-dark",
|
|
2486
2352
|
children: status.category
|
|
2487
2353
|
})
|
|
2488
|
-
}), /*#__PURE__*/jsx(
|
|
2489
|
-
style: _objectSpread$
|
|
2490
|
-
visibility: index === 0 ?
|
|
2354
|
+
}), /*#__PURE__*/jsx(Icon, {
|
|
2355
|
+
style: _objectSpread$6(_objectSpread$6({}, styles$6.statusIcon), {}, {
|
|
2356
|
+
visibility: index === 0 ? "hidden" : "visible"
|
|
2491
2357
|
}),
|
|
2492
|
-
name:
|
|
2358
|
+
name: "arrow-up",
|
|
2493
2359
|
onClick: () => this.onMoveStatus(index, true)
|
|
2494
|
-
}), /*#__PURE__*/jsx(
|
|
2495
|
-
style: _objectSpread$
|
|
2496
|
-
visibility: index === statusTypes.length - 1 ?
|
|
2360
|
+
}), /*#__PURE__*/jsx(Icon, {
|
|
2361
|
+
style: _objectSpread$6(_objectSpread$6({}, styles$6.statusIcon), {}, {
|
|
2362
|
+
visibility: index === statusTypes.length - 1 ? "hidden" : "visible"
|
|
2497
2363
|
}),
|
|
2498
|
-
name:
|
|
2364
|
+
name: "arrow-down",
|
|
2499
2365
|
onClick: () => this.onMoveStatus(index, false)
|
|
2500
|
-
}), /*#__PURE__*/jsx(
|
|
2501
|
-
style: _objectSpread$
|
|
2502
|
-
|
|
2366
|
+
}), /*#__PURE__*/jsx(Icon, {
|
|
2367
|
+
style: _objectSpread$6({}, styles$6.statusIcon),
|
|
2368
|
+
icon: "pencil",
|
|
2503
2369
|
onClick: () => this.onEditStatus(index)
|
|
2504
|
-
}), /*#__PURE__*/jsx(
|
|
2505
|
-
style: _objectSpread$
|
|
2506
|
-
|
|
2370
|
+
}), /*#__PURE__*/jsx(Icon, {
|
|
2371
|
+
style: _objectSpread$6({}, styles$6.statusIcon),
|
|
2372
|
+
icon: "circle-minus",
|
|
2507
2373
|
onClick: () => this.onDeleteStatus(index)
|
|
2508
2374
|
})]
|
|
2509
2375
|
}, "".concat(status.text, "_").concat(index));
|
|
2510
2376
|
}), /*#__PURE__*/jsxs("div", {
|
|
2511
2377
|
onClick: this.onAddStatus,
|
|
2512
2378
|
style: {
|
|
2513
|
-
display:
|
|
2514
|
-
flexDirection:
|
|
2515
|
-
alignItems:
|
|
2379
|
+
display: "flex",
|
|
2380
|
+
flexDirection: "row",
|
|
2381
|
+
alignItems: "center",
|
|
2516
2382
|
marginTop: 16
|
|
2517
2383
|
},
|
|
2518
|
-
children: [/*#__PURE__*/jsx(
|
|
2384
|
+
children: [/*#__PURE__*/jsx(Icon, {
|
|
2519
2385
|
className: "addoption_plus",
|
|
2520
|
-
icon: "
|
|
2386
|
+
icon: "plus",
|
|
2521
2387
|
style: {
|
|
2522
2388
|
fontSize: 12
|
|
2523
2389
|
}
|
|
@@ -2559,8 +2425,8 @@ class Configuration extends Component {
|
|
|
2559
2425
|
renderSuccess() {
|
|
2560
2426
|
if (!this.state.success) return null;
|
|
2561
2427
|
return /*#__PURE__*/jsx("span", {
|
|
2562
|
-
|
|
2563
|
-
color: Colours$
|
|
2428
|
+
iconStyle: _objectSpread$6(_objectSpread$6({}, styles$6.savedText), {}, {
|
|
2429
|
+
color: Colours$3.COLOUR_GREEN
|
|
2564
2430
|
}),
|
|
2565
2431
|
children: "Saved"
|
|
2566
2432
|
});
|
|
@@ -2582,21 +2448,21 @@ class Configuration extends Component {
|
|
|
2582
2448
|
minWidth: 450,
|
|
2583
2449
|
hasPadding: true,
|
|
2584
2450
|
buttons: [{
|
|
2585
|
-
type:
|
|
2451
|
+
type: "primaryAction",
|
|
2586
2452
|
onClick: this.onSaveStatus,
|
|
2587
2453
|
isActive: canSave,
|
|
2588
2454
|
isActive: true,
|
|
2589
|
-
text: submitting ?
|
|
2590
|
-
className:
|
|
2455
|
+
text: submitting ? "Saving..." : "Save",
|
|
2456
|
+
className: "popupButton"
|
|
2591
2457
|
}, {
|
|
2592
|
-
type:
|
|
2458
|
+
type: "outlinedAction",
|
|
2593
2459
|
onClick: this.onHideStatusPopup,
|
|
2594
2460
|
isActive: !submitting,
|
|
2595
|
-
text:
|
|
2596
|
-
className:
|
|
2461
|
+
text: "Cancel",
|
|
2462
|
+
className: "popupButton"
|
|
2597
2463
|
}],
|
|
2598
2464
|
onClose: this.onHideStatusPopup,
|
|
2599
|
-
title: selectedStatusIndex < 0 ?
|
|
2465
|
+
title: selectedStatusIndex < 0 ? "New Status" : "Edit Status",
|
|
2600
2466
|
children: [/*#__PURE__*/jsx(Components$5.GenericInput, {
|
|
2601
2467
|
id: "statusLabel",
|
|
2602
2468
|
type: "text",
|
|
@@ -2615,15 +2481,15 @@ class Configuration extends Component {
|
|
|
2615
2481
|
className: "marginBottom-16",
|
|
2616
2482
|
children: [/*#__PURE__*/jsx("div", {
|
|
2617
2483
|
className: "marginBottom-4",
|
|
2618
|
-
children:
|
|
2484
|
+
children: "This is used to categorise statuses for filtering and analytics purposes"
|
|
2619
2485
|
}), /*#__PURE__*/jsx("div", {
|
|
2620
2486
|
className: "text-bold",
|
|
2621
|
-
children:
|
|
2487
|
+
children: "This status is considered"
|
|
2622
2488
|
})]
|
|
2623
2489
|
}),
|
|
2624
2490
|
className: "marginBottom-20",
|
|
2625
2491
|
rowStyle: {
|
|
2626
|
-
flexDirection:
|
|
2492
|
+
flexDirection: "column"
|
|
2627
2493
|
},
|
|
2628
2494
|
buttonStyle: {
|
|
2629
2495
|
marginBottom: 8
|
|
@@ -2649,7 +2515,7 @@ class Configuration extends Component {
|
|
|
2649
2515
|
})
|
|
2650
2516
|
}]
|
|
2651
2517
|
}), /*#__PURE__*/jsx(Components$5.ColourOptions, {
|
|
2652
|
-
options: [
|
|
2518
|
+
options: ["vibrant", "picker"],
|
|
2653
2519
|
defaultTab: "vibrant",
|
|
2654
2520
|
value: statusColour,
|
|
2655
2521
|
onColourSelected: statusColour => this.setState({
|
|
@@ -2672,11 +2538,11 @@ class Configuration extends Component {
|
|
|
2672
2538
|
}
|
|
2673
2539
|
render() {
|
|
2674
2540
|
return /*#__PURE__*/jsxs("div", {
|
|
2675
|
-
|
|
2676
|
-
minWidth:
|
|
2541
|
+
iconStyle: {
|
|
2542
|
+
minWidth: "100%"
|
|
2677
2543
|
},
|
|
2678
2544
|
children: [this.renderStatuses(), this.renderOtherOptions(), /*#__PURE__*/jsxs("div", {
|
|
2679
|
-
|
|
2545
|
+
iconStyle: {
|
|
2680
2546
|
paddingTop: 24,
|
|
2681
2547
|
paddingBottom: 24
|
|
2682
2548
|
},
|
|
@@ -2689,13 +2555,13 @@ var styles$6 = {
|
|
|
2689
2555
|
statusCategoryHeading: {
|
|
2690
2556
|
marginLeft: 130,
|
|
2691
2557
|
width: 160,
|
|
2692
|
-
textAlign:
|
|
2558
|
+
textAlign: "center",
|
|
2693
2559
|
marginBottom: 12
|
|
2694
2560
|
},
|
|
2695
2561
|
statusTypeContainer: {
|
|
2696
|
-
display:
|
|
2697
|
-
flexDirection:
|
|
2698
|
-
alignItems:
|
|
2562
|
+
display: "flex",
|
|
2563
|
+
flexDirection: "row",
|
|
2564
|
+
alignItems: "center",
|
|
2699
2565
|
marginBottom: 20
|
|
2700
2566
|
},
|
|
2701
2567
|
statusTextContainer: {
|
|
@@ -2703,19 +2569,19 @@ var styles$6 = {
|
|
|
2703
2569
|
},
|
|
2704
2570
|
statusCategoryContainer: {
|
|
2705
2571
|
width: 160,
|
|
2706
|
-
textAlign:
|
|
2572
|
+
textAlign: "center"
|
|
2707
2573
|
},
|
|
2708
2574
|
statusIcon: {
|
|
2709
|
-
cursor:
|
|
2575
|
+
cursor: "pointer",
|
|
2710
2576
|
fontSize: 20,
|
|
2711
2577
|
padding: 5,
|
|
2712
2578
|
marginLeft: 10,
|
|
2713
|
-
color: Colours$
|
|
2714
|
-
visibility:
|
|
2579
|
+
color: Colours$3.COLOUR_BRANDING_ACTION,
|
|
2580
|
+
visibility: "visible"
|
|
2715
2581
|
},
|
|
2716
2582
|
savedText: {
|
|
2717
2583
|
fontSize: 14,
|
|
2718
|
-
lineHeight:
|
|
2584
|
+
lineHeight: "33px",
|
|
2719
2585
|
marginLeft: 15
|
|
2720
2586
|
}
|
|
2721
2587
|
};
|
|
@@ -2743,7 +2609,55 @@ var {
|
|
|
2743
2609
|
} = PlussCore;
|
|
2744
2610
|
class RequestsHub extends Component {
|
|
2745
2611
|
constructor(props) {
|
|
2612
|
+
var _this;
|
|
2746
2613
|
super(props);
|
|
2614
|
+
_this = this;
|
|
2615
|
+
_defineProperty(this, "setData", () => {
|
|
2616
|
+
var allList = [];
|
|
2617
|
+
this.state.allList.forEach(ev => {
|
|
2618
|
+
if (ev != null && !ev.Deleted) allList.push(ev);
|
|
2619
|
+
});
|
|
2620
|
+
var upcoming = _.filter(allList, ev => {
|
|
2621
|
+
if (!ev) return false;
|
|
2622
|
+
if (ev.status && ev.status === "Completed") return false;
|
|
2623
|
+
return true;
|
|
2624
|
+
});
|
|
2625
|
+
var completed = _.filter(allList, ev => {
|
|
2626
|
+
if (!ev) return false;
|
|
2627
|
+
if (ev.status && ev.status === "Completed") return true;
|
|
2628
|
+
return false;
|
|
2629
|
+
});
|
|
2630
|
+
|
|
2631
|
+
// console.log('setData', upcoming, completed);
|
|
2632
|
+
this.setState({
|
|
2633
|
+
allList,
|
|
2634
|
+
upcoming,
|
|
2635
|
+
completed
|
|
2636
|
+
});
|
|
2637
|
+
});
|
|
2638
|
+
_defineProperty(this, "getData", () => {
|
|
2639
|
+
var {
|
|
2640
|
+
auth
|
|
2641
|
+
} = this.props;
|
|
2642
|
+
this.setState({
|
|
2643
|
+
loadingAll: true
|
|
2644
|
+
}, /*#__PURE__*/_asyncToGenerator(function* () {
|
|
2645
|
+
try {
|
|
2646
|
+
var res = yield maintenanceActions.getJobsRecursive(auth.site);
|
|
2647
|
+
_this.setState({
|
|
2648
|
+
loadingAll: false
|
|
2649
|
+
});
|
|
2650
|
+
if (!_.isEmpty(res) && res[0].site === auth.site) {
|
|
2651
|
+
_this.props.jobsLoaded(res);
|
|
2652
|
+
}
|
|
2653
|
+
} catch (error) {
|
|
2654
|
+
console.error("getData", error);
|
|
2655
|
+
_this.setState({
|
|
2656
|
+
loadingAll: false
|
|
2657
|
+
});
|
|
2658
|
+
}
|
|
2659
|
+
}));
|
|
2660
|
+
});
|
|
2747
2661
|
_defineProperty(this, "onAddNew", () => {
|
|
2748
2662
|
var {
|
|
2749
2663
|
auth
|
|
@@ -2764,74 +2678,91 @@ class RequestsHub extends Component {
|
|
|
2764
2678
|
var {
|
|
2765
2679
|
auth
|
|
2766
2680
|
} = this.props;
|
|
2767
|
-
if (Session$4.validateAccess(auth.site, values.permissionMaintenanceTracking, auth)) return isClass ?
|
|
2768
|
-
return isClass ?
|
|
2681
|
+
if (Session$4.validateAccess(auth.site, values.permissionMaintenanceTracking, auth)) return isClass ? "" : true;
|
|
2682
|
+
return isClass ? " hub-sideContent-topButton--hide" : false;
|
|
2769
2683
|
});
|
|
2770
2684
|
_defineProperty(this, "getSideBarSectionColour", id => this.state.selectedSection === id ? {
|
|
2771
|
-
backgroundColor:
|
|
2685
|
+
backgroundColor: "#fff"
|
|
2772
2686
|
} : {});
|
|
2773
|
-
_defineProperty(this, "renderStats", (stat, loading) => loading ? /*#__PURE__*/jsx(
|
|
2687
|
+
_defineProperty(this, "renderStats", (stat, loading) => loading ? /*#__PURE__*/jsx(Icon, {
|
|
2774
2688
|
style: styles$5.spinner,
|
|
2775
|
-
|
|
2689
|
+
icon: "spinner",
|
|
2690
|
+
pulse: true,
|
|
2691
|
+
fixedWidth: true
|
|
2776
2692
|
}) : stat);
|
|
2777
2693
|
this.state = {
|
|
2778
|
-
selectedSection:
|
|
2779
|
-
location:
|
|
2694
|
+
selectedSection: "all",
|
|
2695
|
+
location: "",
|
|
2696
|
+
loadingAll: false,
|
|
2780
2697
|
loadingSubmissions: false,
|
|
2781
2698
|
submissionEntries: [],
|
|
2699
|
+
allList: [],
|
|
2700
|
+
completed: [],
|
|
2701
|
+
upcoming: [],
|
|
2782
2702
|
now: moment.utc(),
|
|
2783
2703
|
onlyFuture: true,
|
|
2784
|
-
search:
|
|
2704
|
+
search: ""
|
|
2785
2705
|
};
|
|
2786
2706
|
}
|
|
2707
|
+
UNSAFE_componentWillMount() {
|
|
2708
|
+
this.updateProps(this.props);
|
|
2709
|
+
}
|
|
2787
2710
|
componentDidMount() {
|
|
2788
|
-
|
|
2711
|
+
this.getData();
|
|
2712
|
+
}
|
|
2713
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
2714
|
+
if (!_.isEqual(this.props.jobs, nextProps.jobs)) this.updateProps(nextProps);
|
|
2715
|
+
}
|
|
2716
|
+
updateProps(props) {
|
|
2717
|
+
this.setState({
|
|
2718
|
+
allList: props.jobs
|
|
2719
|
+
}, this.setData);
|
|
2789
2720
|
}
|
|
2790
2721
|
renderLeftBar() {
|
|
2791
2722
|
var sectionItems = [];
|
|
2792
2723
|
if (this.canAddNew()) {
|
|
2793
2724
|
sectionItems.push({
|
|
2794
|
-
type:
|
|
2725
|
+
type: "newButton",
|
|
2795
2726
|
text: "New ".concat(values.textSingularName),
|
|
2796
2727
|
onClick: this.onAddNew
|
|
2797
2728
|
});
|
|
2798
2729
|
}
|
|
2799
2730
|
sectionItems.push({
|
|
2800
|
-
type:
|
|
2731
|
+
type: "navItem",
|
|
2801
2732
|
text: "View ".concat(values.textSingularName, "s"),
|
|
2802
|
-
icon:
|
|
2733
|
+
icon: "eye",
|
|
2803
2734
|
isFontAwesome: true,
|
|
2804
|
-
selected: this.state.selectedSection ===
|
|
2735
|
+
selected: this.state.selectedSection === "all",
|
|
2805
2736
|
onClick: () => {
|
|
2806
2737
|
this.setState({
|
|
2807
|
-
selectedSection:
|
|
2738
|
+
selectedSection: "all"
|
|
2808
2739
|
});
|
|
2809
2740
|
}
|
|
2810
2741
|
});
|
|
2811
2742
|
if (Session$4.validateAccess(this.props.auth.site, values.permissionMaintenanceTypes, this.props.auth)) {
|
|
2812
2743
|
sectionItems.push({
|
|
2813
|
-
type:
|
|
2744
|
+
type: "navItem",
|
|
2814
2745
|
text: values.textTitleJobTypes,
|
|
2815
2746
|
// icon: 'maintenance2',
|
|
2816
2747
|
// isSVG: true,
|
|
2817
|
-
selected: this.state.selectedSection ===
|
|
2748
|
+
selected: this.state.selectedSection === "requestTypes",
|
|
2818
2749
|
onClick: () => {
|
|
2819
2750
|
this.setState({
|
|
2820
|
-
selectedSection:
|
|
2751
|
+
selectedSection: "requestTypes"
|
|
2821
2752
|
});
|
|
2822
2753
|
}
|
|
2823
2754
|
});
|
|
2824
2755
|
}
|
|
2825
|
-
if (Session$4.validateAccess(this.props.auth.site,
|
|
2756
|
+
if (Session$4.validateAccess(this.props.auth.site, "featurePicker", this.props.auth)) {
|
|
2826
2757
|
sectionItems.push({
|
|
2827
|
-
type:
|
|
2828
|
-
text:
|
|
2829
|
-
icon:
|
|
2758
|
+
type: "navItem",
|
|
2759
|
+
text: "Feature Configuration",
|
|
2760
|
+
icon: "settings",
|
|
2830
2761
|
isFontAwesome: false,
|
|
2831
|
-
selected: this.state.selectedSection ===
|
|
2762
|
+
selected: this.state.selectedSection === "config",
|
|
2832
2763
|
onClick: () => {
|
|
2833
2764
|
this.setState({
|
|
2834
|
-
selectedSection:
|
|
2765
|
+
selectedSection: "config"
|
|
2835
2766
|
});
|
|
2836
2767
|
}
|
|
2837
2768
|
});
|
|
@@ -2849,14 +2780,16 @@ class RequestsHub extends Component {
|
|
|
2849
2780
|
});
|
|
2850
2781
|
}
|
|
2851
2782
|
renderRight() {
|
|
2852
|
-
if (this.state.selectedSection ===
|
|
2783
|
+
if (this.state.selectedSection === "requestTypes") {
|
|
2853
2784
|
return /*#__PURE__*/jsx(JobTypes$1, {
|
|
2854
2785
|
onNew: this.onAddRequestType
|
|
2855
2786
|
});
|
|
2856
|
-
} else if (this.state.selectedSection ===
|
|
2787
|
+
} else if (this.state.selectedSection === "config") {
|
|
2857
2788
|
return /*#__PURE__*/jsx(Configuration$1, {});
|
|
2858
2789
|
}
|
|
2859
|
-
return /*#__PURE__*/jsx(JobList$1, {
|
|
2790
|
+
return /*#__PURE__*/jsx(JobList$1, {
|
|
2791
|
+
source: this.state.allList
|
|
2792
|
+
});
|
|
2860
2793
|
}
|
|
2861
2794
|
render() {
|
|
2862
2795
|
return /*#__PURE__*/jsxs("div", {
|
|
@@ -2873,21 +2806,21 @@ class RequestsHub extends Component {
|
|
|
2873
2806
|
}
|
|
2874
2807
|
var styles$5 = {
|
|
2875
2808
|
sideBarTitleSection: {
|
|
2876
|
-
lineHeight:
|
|
2809
|
+
lineHeight: "40px",
|
|
2877
2810
|
marginTop: 30,
|
|
2878
2811
|
marginBottom: 30,
|
|
2879
2812
|
paddingLeft: 24,
|
|
2880
2813
|
paddingRight: 24
|
|
2881
2814
|
},
|
|
2882
2815
|
sideBarSection: {
|
|
2883
|
-
weight:
|
|
2816
|
+
weight: "100%",
|
|
2884
2817
|
minWidth: 200,
|
|
2885
2818
|
padding: 32,
|
|
2886
2819
|
paddingLeft: 24,
|
|
2887
|
-
cursor:
|
|
2888
|
-
display:
|
|
2889
|
-
flexDirection:
|
|
2890
|
-
justifyContent:
|
|
2820
|
+
cursor: "pointer",
|
|
2821
|
+
display: "flex",
|
|
2822
|
+
flexDirection: "column",
|
|
2823
|
+
justifyContent: "center"
|
|
2891
2824
|
},
|
|
2892
2825
|
spinner: {
|
|
2893
2826
|
fontSize: 32,
|
|
@@ -2899,19 +2832,22 @@ var mapStateToProps$4 = state => {
|
|
|
2899
2832
|
auth
|
|
2900
2833
|
} = state;
|
|
2901
2834
|
return {
|
|
2835
|
+
jobs: state[values.reducerKey].jobs,
|
|
2902
2836
|
auth,
|
|
2903
2837
|
strings: state.strings && state.strings.config || {}
|
|
2904
2838
|
};
|
|
2905
2839
|
};
|
|
2906
|
-
var RequestsHub$1 = connect(mapStateToProps$4, {
|
|
2840
|
+
var RequestsHub$1 = connect(mapStateToProps$4, {
|
|
2841
|
+
jobsLoaded
|
|
2842
|
+
})(withRouter(RequestsHub));
|
|
2907
2843
|
|
|
2908
|
-
function ownKeys$
|
|
2909
|
-
function _objectSpread$
|
|
2844
|
+
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; }
|
|
2845
|
+
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; }
|
|
2910
2846
|
var {
|
|
2911
2847
|
Apis: Apis$1,
|
|
2912
|
-
Helper: Helper$
|
|
2848
|
+
Helper: Helper$3,
|
|
2913
2849
|
Session: Session$3,
|
|
2914
|
-
Colours: Colours$
|
|
2850
|
+
Colours: Colours$2,
|
|
2915
2851
|
Components: Components$3
|
|
2916
2852
|
} = PlussCore;
|
|
2917
2853
|
var IMAGE_SIZE_NOTE = 72;
|
|
@@ -2995,7 +2931,7 @@ class Job extends Component {
|
|
|
2995
2931
|
var statusType = statusTypes.find(s => s.text === status);
|
|
2996
2932
|
if (!statusType) {
|
|
2997
2933
|
var defaultStatus = statusTypes.find(s => s.category === STATUS_NOT_ACTIONED);
|
|
2998
|
-
statusType = _objectSpread$
|
|
2934
|
+
statusType = _objectSpread$5(_objectSpread$5({}, defaultStatus), {}, {
|
|
2999
2935
|
text: status
|
|
3000
2936
|
});
|
|
3001
2937
|
}
|
|
@@ -3190,7 +3126,7 @@ class Job extends Component {
|
|
|
3190
3126
|
}
|
|
3191
3127
|
maintenanceActions.deleteNote(this.state.jobId, n.Id);
|
|
3192
3128
|
var newNotes = _.filter(this.state.job.Notes, note => note.Id !== n.Id);
|
|
3193
|
-
var newJob = _objectSpread$
|
|
3129
|
+
var newJob = _objectSpread$5({}, this.state.job);
|
|
3194
3130
|
newJob.Notes = newNotes;
|
|
3195
3131
|
this.setState({
|
|
3196
3132
|
job: newJob,
|
|
@@ -3275,7 +3211,7 @@ class Job extends Component {
|
|
|
3275
3211
|
_defineProperty(this, "onSelectPriority", /*#__PURE__*/function () {
|
|
3276
3212
|
var _ref0 = _asyncToGenerator(function* (priority) {
|
|
3277
3213
|
_this.setState({
|
|
3278
|
-
job: _objectSpread$
|
|
3214
|
+
job: _objectSpread$5(_objectSpread$5({}, _this.state.job), {}, {
|
|
3279
3215
|
priority
|
|
3280
3216
|
}),
|
|
3281
3217
|
priorityChangerOpen: false
|
|
@@ -3305,7 +3241,7 @@ class Job extends Component {
|
|
|
3305
3241
|
_defineProperty(this, "onSelectStatus", /*#__PURE__*/function () {
|
|
3306
3242
|
var _ref1 = _asyncToGenerator(function* (status) {
|
|
3307
3243
|
_this.setState({
|
|
3308
|
-
job: _objectSpread$
|
|
3244
|
+
job: _objectSpread$5(_objectSpread$5({}, _this.state.job), {}, {
|
|
3309
3245
|
status: status
|
|
3310
3246
|
}),
|
|
3311
3247
|
statusChangerOpen: false
|
|
@@ -3328,7 +3264,7 @@ class Job extends Component {
|
|
|
3328
3264
|
};
|
|
3329
3265
|
}());
|
|
3330
3266
|
this.state = {
|
|
3331
|
-
jobId: Helper$
|
|
3267
|
+
jobId: Helper$3.safeReadParams(props, "jobId") ? props.match.params.jobId : null,
|
|
3332
3268
|
job: null,
|
|
3333
3269
|
showingSelector: false,
|
|
3334
3270
|
updating: false,
|
|
@@ -3520,9 +3456,9 @@ class Job extends Component {
|
|
|
3520
3456
|
children: [/*#__PURE__*/jsx("div", {
|
|
3521
3457
|
className: "commentReply_button".concat(!_.isEmpty(this.state.commentInput) ? " commentReply_button-active" : ""),
|
|
3522
3458
|
onClick: this.onAddComment,
|
|
3523
|
-
children: /*#__PURE__*/jsx(
|
|
3459
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
3524
3460
|
className: "commentReply_icon",
|
|
3525
|
-
|
|
3461
|
+
icon: "paper-plane"
|
|
3526
3462
|
})
|
|
3527
3463
|
}), /*#__PURE__*/jsx(Textarea, {
|
|
3528
3464
|
id: "commentInput",
|
|
@@ -3549,7 +3485,7 @@ class Job extends Component {
|
|
|
3549
3485
|
children: /*#__PURE__*/jsx("div", {
|
|
3550
3486
|
className: "imageGrid_image",
|
|
3551
3487
|
style: {
|
|
3552
|
-
backgroundImage: "url('".concat(Helper$
|
|
3488
|
+
backgroundImage: "url('".concat(Helper$3.get1400(image), "')"),
|
|
3553
3489
|
width: size,
|
|
3554
3490
|
height: size
|
|
3555
3491
|
}
|
|
@@ -3645,7 +3581,7 @@ class Job extends Component {
|
|
|
3645
3581
|
} = this.state.job;
|
|
3646
3582
|
var hasCustomFields = customFields && customFields.length > 0;
|
|
3647
3583
|
return /*#__PURE__*/jsxs("div", {
|
|
3648
|
-
|
|
3584
|
+
iconStyle: {
|
|
3649
3585
|
paddingBottom: 40
|
|
3650
3586
|
},
|
|
3651
3587
|
children: [/*#__PURE__*/jsxs("div", {
|
|
@@ -3793,9 +3729,9 @@ class Job extends Component {
|
|
|
3793
3729
|
className: "maintenanceNote",
|
|
3794
3730
|
children: [/*#__PURE__*/jsxs("div", {
|
|
3795
3731
|
className: "maintenanceNote_top",
|
|
3796
|
-
children: [this.props.auth && this.props.auth.user && this.props.auth.user.Id === note.User.id && /*#__PURE__*/jsx(
|
|
3797
|
-
colour: Colours$
|
|
3798
|
-
icon: "
|
|
3732
|
+
children: [this.props.auth && this.props.auth.user && this.props.auth.user.Id === note.User.id && /*#__PURE__*/jsx(Icon, {
|
|
3733
|
+
colour: Colours$2.COLOUR_DUSK_LIGHT,
|
|
3734
|
+
icon: "ellipsis-vertical",
|
|
3799
3735
|
className: "maintenanceNote_moreIcon",
|
|
3800
3736
|
onClick: () => this.onOpenNoteMenu(index)
|
|
3801
3737
|
}), /*#__PURE__*/jsx("p", {
|
|
@@ -3814,7 +3750,7 @@ class Job extends Component {
|
|
|
3814
3750
|
})]
|
|
3815
3751
|
}), /*#__PURE__*/jsx("p", {
|
|
3816
3752
|
className: "maintenanceNote_text",
|
|
3817
|
-
children: Helper$
|
|
3753
|
+
children: Helper$3.toParagraphed(note.Note)
|
|
3818
3754
|
}), note.Attachments.map((a, i) => this.renderAttachment(a, i)), note.Images && note.Images.length > 0 ? this.renderImageGrid(note.Images, IMAGE_SIZE_NOTE) : null]
|
|
3819
3755
|
})]
|
|
3820
3756
|
}, index);
|
|
@@ -3858,7 +3794,7 @@ class Job extends Component {
|
|
|
3858
3794
|
}), /*#__PURE__*/jsx("div", {
|
|
3859
3795
|
className: "statusLabel statusLabel-large statusLabel-full",
|
|
3860
3796
|
style: {
|
|
3861
|
-
backgroundColor: Colours$
|
|
3797
|
+
backgroundColor: Colours$2.COLOUR_DUSK
|
|
3862
3798
|
},
|
|
3863
3799
|
children: /*#__PURE__*/jsxs("span", {
|
|
3864
3800
|
className: "statusLabel_text",
|
|
@@ -3869,7 +3805,7 @@ class Job extends Component {
|
|
|
3869
3805
|
}
|
|
3870
3806
|
renderExternalSyncEntry(e, i) {
|
|
3871
3807
|
var isSuccess = e.EntryType === "ExternalIDSet";
|
|
3872
|
-
var backgroundColor = isSuccess ? Colours$
|
|
3808
|
+
var backgroundColor = isSuccess ? Colours$2.COLOUR_GREEN : Colours$2.COLOUR_RED; // Green for success, red for failure
|
|
3873
3809
|
|
|
3874
3810
|
return /*#__PURE__*/jsxs("div", {
|
|
3875
3811
|
className: "ticketHistoryEntry",
|
|
@@ -3932,20 +3868,22 @@ class Job extends Component {
|
|
|
3932
3868
|
|
|
3933
3869
|
// Show spinner while retrying
|
|
3934
3870
|
if (retryingSync) {
|
|
3935
|
-
return /*#__PURE__*/jsx(
|
|
3871
|
+
return /*#__PURE__*/jsx(Icon, {
|
|
3936
3872
|
style: {
|
|
3937
3873
|
fontSize: 20,
|
|
3938
|
-
color: Colours$
|
|
3874
|
+
color: Colours$2.COLOUR_DUSK_LIGHT,
|
|
3939
3875
|
marginLeft: 8
|
|
3940
3876
|
},
|
|
3941
|
-
|
|
3877
|
+
icon: "spinner",
|
|
3878
|
+
pulse: true,
|
|
3879
|
+
fixedWidth: true
|
|
3942
3880
|
});
|
|
3943
3881
|
}
|
|
3944
3882
|
return /*#__PURE__*/jsx("div", {
|
|
3945
3883
|
className: "statusLabel pointer",
|
|
3946
3884
|
onClick: this.onRetrySync,
|
|
3947
3885
|
style: {
|
|
3948
|
-
backgroundColor: Colours$
|
|
3886
|
+
backgroundColor: Colours$2.COLOUR_RED,
|
|
3949
3887
|
marginLeft: 8
|
|
3950
3888
|
},
|
|
3951
3889
|
children: /*#__PURE__*/jsx("span", {
|
|
@@ -3964,11 +3902,11 @@ class Job extends Component {
|
|
|
3964
3902
|
if (retrySyncError) {
|
|
3965
3903
|
return /*#__PURE__*/jsxs(Components$3.Text, {
|
|
3966
3904
|
type: "body",
|
|
3967
|
-
children: [/*#__PURE__*/jsx(
|
|
3905
|
+
children: [/*#__PURE__*/jsx(Icon, {
|
|
3968
3906
|
className: "userStatusIcon",
|
|
3969
|
-
|
|
3907
|
+
icon: "circle-xmark",
|
|
3970
3908
|
style: {
|
|
3971
|
-
color: Colours$
|
|
3909
|
+
color: Colours$2.COLOUR_RED
|
|
3972
3910
|
}
|
|
3973
3911
|
}), " ", retrySyncError]
|
|
3974
3912
|
});
|
|
@@ -3978,11 +3916,11 @@ class Job extends Component {
|
|
|
3978
3916
|
if (retrySyncInitiated) {
|
|
3979
3917
|
return /*#__PURE__*/jsxs(Components$3.Text, {
|
|
3980
3918
|
type: "body",
|
|
3981
|
-
children: [/*#__PURE__*/jsx(
|
|
3919
|
+
children: [/*#__PURE__*/jsx(Icon, {
|
|
3982
3920
|
className: "userStatusIcon",
|
|
3983
|
-
|
|
3921
|
+
icon: "circle-check",
|
|
3984
3922
|
style: {
|
|
3985
|
-
color: Colours$
|
|
3923
|
+
color: Colours$2.COLOUR_GREEN
|
|
3986
3924
|
}
|
|
3987
3925
|
}), " ", "Sync retry initiated. Check back shortly for results."]
|
|
3988
3926
|
});
|
|
@@ -3992,11 +3930,11 @@ class Job extends Component {
|
|
|
3992
3930
|
if (this.hasSyncFailureWithoutSuccess()) {
|
|
3993
3931
|
return /*#__PURE__*/jsxs(Components$3.Text, {
|
|
3994
3932
|
type: "body",
|
|
3995
|
-
children: [/*#__PURE__*/jsx(
|
|
3933
|
+
children: [/*#__PURE__*/jsx(Icon, {
|
|
3996
3934
|
className: "userStatusIcon",
|
|
3997
|
-
|
|
3935
|
+
icon: "circle-xmark",
|
|
3998
3936
|
style: {
|
|
3999
|
-
color: Colours$
|
|
3937
|
+
color: Colours$2.COLOUR_RED
|
|
4000
3938
|
}
|
|
4001
3939
|
}), " ", "External sync failed. Use the retry button to attempt again."]
|
|
4002
3940
|
});
|
|
@@ -4056,11 +3994,11 @@ class Job extends Component {
|
|
|
4056
3994
|
} = this.state;
|
|
4057
3995
|
if (!job || !job.history) return null;
|
|
4058
3996
|
var source = _.sortBy([...job.history.map(e => {
|
|
4059
|
-
return _objectSpread$
|
|
3997
|
+
return _objectSpread$5(_objectSpread$5({}, e), {}, {
|
|
4060
3998
|
EntryType: e.EntryType || "status"
|
|
4061
3999
|
});
|
|
4062
4000
|
}), ...(job.Notes || []).map(e => {
|
|
4063
|
-
return _objectSpread$
|
|
4001
|
+
return _objectSpread$5(_objectSpread$5({}, e), {}, {
|
|
4064
4002
|
timestamp: e.Timestamp,
|
|
4065
4003
|
EntryType: "note"
|
|
4066
4004
|
});
|
|
@@ -4135,9 +4073,11 @@ class Job extends Component {
|
|
|
4135
4073
|
hasPadding: true,
|
|
4136
4074
|
children: /*#__PURE__*/jsx("div", {
|
|
4137
4075
|
className: "flex flex-center-row",
|
|
4138
|
-
children: /*#__PURE__*/jsx(
|
|
4076
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
4139
4077
|
className: "spinner",
|
|
4140
|
-
|
|
4078
|
+
icon: "spinner",
|
|
4079
|
+
pulse: true,
|
|
4080
|
+
fixedWidth: true
|
|
4141
4081
|
})
|
|
4142
4082
|
})
|
|
4143
4083
|
});
|
|
@@ -4183,9 +4123,9 @@ class Job extends Component {
|
|
|
4183
4123
|
onClick: () => {
|
|
4184
4124
|
this.attachmentInput.click();
|
|
4185
4125
|
},
|
|
4186
|
-
children: [/*#__PURE__*/jsx(
|
|
4126
|
+
children: [/*#__PURE__*/jsx(Icon, {
|
|
4187
4127
|
className: "iconTextButton_icon",
|
|
4188
|
-
|
|
4128
|
+
icon: "paperclip"
|
|
4189
4129
|
}), /*#__PURE__*/jsx("p", {
|
|
4190
4130
|
className: "iconTextButton_text",
|
|
4191
4131
|
children: "Add Attachment"
|
|
@@ -4208,22 +4148,24 @@ class Job extends Component {
|
|
|
4208
4148
|
if (this.state.confirmingAssignee) {
|
|
4209
4149
|
content = /*#__PURE__*/jsx("div", {
|
|
4210
4150
|
className: "flex flex-center-row",
|
|
4211
|
-
children: /*#__PURE__*/jsx(
|
|
4151
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
4212
4152
|
className: "spinner",
|
|
4213
|
-
|
|
4153
|
+
icon: "spinner",
|
|
4154
|
+
pulse: true,
|
|
4155
|
+
fixedWidth: true
|
|
4214
4156
|
})
|
|
4215
4157
|
});
|
|
4216
4158
|
} else if (this.state.selectedAssignee) {
|
|
4217
4159
|
content = /*#__PURE__*/jsx("div", {
|
|
4218
4160
|
children: /*#__PURE__*/jsx(Components$3.UserListing, {
|
|
4219
4161
|
user: this.state.selectedAssignee,
|
|
4220
|
-
rightContent: /*#__PURE__*/jsx(
|
|
4162
|
+
rightContent: /*#__PURE__*/jsx(Icon, {
|
|
4221
4163
|
className: "removeIcon",
|
|
4222
|
-
icon: "
|
|
4164
|
+
icon: "xmark",
|
|
4223
4165
|
onClick: () => {
|
|
4224
4166
|
this.onSelectAssignee();
|
|
4225
4167
|
},
|
|
4226
|
-
colour: Colours$
|
|
4168
|
+
colour: Colours$2.COLOUR_DUSK
|
|
4227
4169
|
})
|
|
4228
4170
|
}, this.state.selectedAssignee.id)
|
|
4229
4171
|
});
|
|
@@ -4310,14 +4252,14 @@ var Job$1 = connect(mapStateToProps$3, {
|
|
|
4310
4252
|
jobStatusesUpdate
|
|
4311
4253
|
})(withRouter(Job));
|
|
4312
4254
|
|
|
4313
|
-
function ownKeys$
|
|
4314
|
-
function _objectSpread$
|
|
4255
|
+
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; }
|
|
4256
|
+
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; }
|
|
4315
4257
|
var {
|
|
4316
4258
|
Actions,
|
|
4317
4259
|
Components: Components$2,
|
|
4318
|
-
Helper: Helper$
|
|
4260
|
+
Helper: Helper$2,
|
|
4319
4261
|
Session: Session$2,
|
|
4320
|
-
Colours,
|
|
4262
|
+
Colours: Colours$1,
|
|
4321
4263
|
Apis
|
|
4322
4264
|
} = PlussCore;
|
|
4323
4265
|
class AddJob extends Component {
|
|
@@ -4336,7 +4278,7 @@ class AddJob extends Component {
|
|
|
4336
4278
|
type,
|
|
4337
4279
|
customFields
|
|
4338
4280
|
} = res.data;
|
|
4339
|
-
_this.setState(_objectSpread$
|
|
4281
|
+
_this.setState(_objectSpread$4(_objectSpread$4({}, res.data), {}, {
|
|
4340
4282
|
prevType: type,
|
|
4341
4283
|
prevCustomFileds: customFields,
|
|
4342
4284
|
type,
|
|
@@ -4584,7 +4526,7 @@ class AddJob extends Component {
|
|
|
4584
4526
|
event.target.value = "";
|
|
4585
4527
|
});
|
|
4586
4528
|
_defineProperty(this, "onToggleDatePicker", qId => {
|
|
4587
|
-
var showDate = _objectSpread$
|
|
4529
|
+
var showDate = _objectSpread$4({}, this.state.showDate);
|
|
4588
4530
|
showDate[qId] = !showDate[qId];
|
|
4589
4531
|
this.setState({
|
|
4590
4532
|
showDate
|
|
@@ -4673,7 +4615,7 @@ class AddJob extends Component {
|
|
|
4673
4615
|
if (_.isNil(answer) || _.isEmpty(answer)) return true;
|
|
4674
4616
|
switch (type) {
|
|
4675
4617
|
case "email":
|
|
4676
|
-
return Helper$
|
|
4618
|
+
return Helper$2.isEmail(answer);
|
|
4677
4619
|
case "date":
|
|
4678
4620
|
return moment(answer, "YYYY-MM-DD", true).isValid();
|
|
4679
4621
|
case "time":
|
|
@@ -4694,7 +4636,7 @@ class AddJob extends Component {
|
|
|
4694
4636
|
this.customImageInputs = {};
|
|
4695
4637
|
this.customDocumentInputs = {};
|
|
4696
4638
|
this.state = {
|
|
4697
|
-
jobId: Helper$
|
|
4639
|
+
jobId: Helper$2.safeReadParams(this.props, "jobId") ? this.props.match.params.jobId : null,
|
|
4698
4640
|
job: null,
|
|
4699
4641
|
showingSelector: false,
|
|
4700
4642
|
updating: false,
|
|
@@ -4753,9 +4695,9 @@ class AddJob extends Component {
|
|
|
4753
4695
|
} = this.state;
|
|
4754
4696
|
return types.map(ev => {
|
|
4755
4697
|
if (ev != null) {
|
|
4756
|
-
return /*#__PURE__*/jsx(
|
|
4698
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
4757
4699
|
eventKey: ev.typeName,
|
|
4758
|
-
|
|
4700
|
+
active: type === ev.typeName,
|
|
4759
4701
|
children: ev.typeName
|
|
4760
4702
|
}, ev.typeName);
|
|
4761
4703
|
}
|
|
@@ -5011,7 +4953,7 @@ class AddJob extends Component {
|
|
|
5011
4953
|
className: "inputRequired "
|
|
5012
4954
|
}) : null, /*#__PURE__*/jsxs("div", {
|
|
5013
4955
|
className: "visitorSignIn_question",
|
|
5014
|
-
|
|
4956
|
+
iconStyle: {
|
|
5015
4957
|
flex: 1
|
|
5016
4958
|
},
|
|
5017
4959
|
children: [/*#__PURE__*/jsx("div", {
|
|
@@ -5061,7 +5003,7 @@ class AddJob extends Component {
|
|
|
5061
5003
|
case "staticText":
|
|
5062
5004
|
return /*#__PURE__*/jsx("p", {
|
|
5063
5005
|
className: "visitorSignIn_text-staticText",
|
|
5064
|
-
children: Helper$
|
|
5006
|
+
children: Helper$2.toParagraphed(field.label, {
|
|
5065
5007
|
marginTop: 10
|
|
5066
5008
|
})
|
|
5067
5009
|
}, fieldId);
|
|
@@ -5079,9 +5021,9 @@ class AddJob extends Component {
|
|
|
5079
5021
|
errorMessage: "Not a valid date",
|
|
5080
5022
|
alwaysShowLabel: true,
|
|
5081
5023
|
readOnly: true,
|
|
5082
|
-
rightContent: !_.isEmpty(field.answer) && /*#__PURE__*/jsx(
|
|
5083
|
-
colour: Colours.COLOUR_DUSK_LIGHT,
|
|
5084
|
-
icon: "
|
|
5024
|
+
rightContent: !_.isEmpty(field.answer) && /*#__PURE__*/jsx(Icon, {
|
|
5025
|
+
colour: Colours$1.COLOUR_DUSK_LIGHT,
|
|
5026
|
+
icon: "xmark",
|
|
5085
5027
|
className: "timepicker_clear",
|
|
5086
5028
|
onClick: () => this.onChangeDateAnswer(fieldId, undefined, false)
|
|
5087
5029
|
})
|
|
@@ -5112,9 +5054,9 @@ class AddJob extends Component {
|
|
|
5112
5054
|
width: "100%"
|
|
5113
5055
|
}
|
|
5114
5056
|
}),
|
|
5115
|
-
rightContent: !_.isEmpty(field.answer) && /*#__PURE__*/jsx(
|
|
5116
|
-
colour: Colours.COLOUR_DUSK_LIGHT,
|
|
5117
|
-
icon: "
|
|
5057
|
+
rightContent: !_.isEmpty(field.answer) && /*#__PURE__*/jsx(Icon, {
|
|
5058
|
+
colour: Colours$1.COLOUR_DUSK_LIGHT,
|
|
5059
|
+
icon: "xmark",
|
|
5118
5060
|
className: "timepicker_clear",
|
|
5119
5061
|
onClick: () => this.onChangeTimeAnswer(fieldId, undefined)
|
|
5120
5062
|
})
|
|
@@ -5128,7 +5070,7 @@ class AddJob extends Component {
|
|
|
5128
5070
|
className: "inputRequired "
|
|
5129
5071
|
}) : null, /*#__PURE__*/jsxs("div", {
|
|
5130
5072
|
className: "visitorSignIn_question",
|
|
5131
|
-
|
|
5073
|
+
iconStyle: {
|
|
5132
5074
|
flex: 1
|
|
5133
5075
|
},
|
|
5134
5076
|
children: [/*#__PURE__*/jsx(Components$2.Text, {
|
|
@@ -5151,7 +5093,7 @@ class AddJob extends Component {
|
|
|
5151
5093
|
className: "inputRequired "
|
|
5152
5094
|
}) : null, /*#__PURE__*/jsxs("div", {
|
|
5153
5095
|
className: "visitorSignIn_question",
|
|
5154
|
-
|
|
5096
|
+
iconStyle: {
|
|
5155
5097
|
flex: 1
|
|
5156
5098
|
},
|
|
5157
5099
|
children: [/*#__PURE__*/jsx(Components$2.Text, {
|
|
@@ -5173,9 +5115,9 @@ class AddJob extends Component {
|
|
|
5173
5115
|
}), /*#__PURE__*/jsxs("div", {
|
|
5174
5116
|
className: "iconTextButton marginBottom-16",
|
|
5175
5117
|
onClick: () => this.customDocumentInputs[fieldId].click(),
|
|
5176
|
-
children: [/*#__PURE__*/jsx(
|
|
5118
|
+
children: [/*#__PURE__*/jsx(Icon, {
|
|
5177
5119
|
className: "iconTextButton_icon",
|
|
5178
|
-
|
|
5120
|
+
icon: "paperclip"
|
|
5179
5121
|
}), /*#__PURE__*/jsx("p", {
|
|
5180
5122
|
className: "iconTextButton_text",
|
|
5181
5123
|
children: "Add Attachment"
|
|
@@ -5203,7 +5145,7 @@ class AddJob extends Component {
|
|
|
5203
5145
|
customFields
|
|
5204
5146
|
} = this.state;
|
|
5205
5147
|
return /*#__PURE__*/jsx("div", {
|
|
5206
|
-
|
|
5148
|
+
iconStyle: {
|
|
5207
5149
|
marginBottom: 15
|
|
5208
5150
|
},
|
|
5209
5151
|
children: /*#__PURE__*/jsxs("div", {
|
|
@@ -5238,7 +5180,7 @@ class AddJob extends Component {
|
|
|
5238
5180
|
return this.state.showWarnings && _.isEmpty(this.state.room);
|
|
5239
5181
|
}
|
|
5240
5182
|
}), /*#__PURE__*/jsxs("div", {
|
|
5241
|
-
|
|
5183
|
+
iconStyle: {
|
|
5242
5184
|
marginBottom: 15
|
|
5243
5185
|
},
|
|
5244
5186
|
children: [/*#__PURE__*/jsx(Components$2.Text, {
|
|
@@ -5338,7 +5280,7 @@ var mapStateToProps$2 = state => {
|
|
|
5338
5280
|
return {
|
|
5339
5281
|
auth,
|
|
5340
5282
|
strings: state.strings && state.strings.config || {},
|
|
5341
|
-
optionOnlyForResidents: Helper$
|
|
5283
|
+
optionOnlyForResidents: Helper$2.getSiteSettingFromState(state, values.optionOnlyForResidents)
|
|
5342
5284
|
};
|
|
5343
5285
|
};
|
|
5344
5286
|
var AddJob$1 = connect(mapStateToProps$2, {
|
|
@@ -5350,14 +5292,14 @@ var AddJob$1 = connect(mapStateToProps$2, {
|
|
|
5350
5292
|
var {
|
|
5351
5293
|
Components: Components$1,
|
|
5352
5294
|
Session: Session$1,
|
|
5353
|
-
Helper
|
|
5295
|
+
Helper: Helper$1
|
|
5354
5296
|
} = PlussCore;
|
|
5355
5297
|
var DEFAULT_FIELD = {
|
|
5356
|
-
type:
|
|
5357
|
-
label:
|
|
5298
|
+
type: "text",
|
|
5299
|
+
label: "",
|
|
5358
5300
|
mandatory: false,
|
|
5359
5301
|
isTitle: false,
|
|
5360
|
-
values: [
|
|
5302
|
+
values: [""]
|
|
5361
5303
|
};
|
|
5362
5304
|
class AddJobType extends Component {
|
|
5363
5305
|
constructor(props) {
|
|
@@ -5384,18 +5326,18 @@ class AddJobType extends Component {
|
|
|
5384
5326
|
customFields: customFields || [_.cloneDeep(DEFAULT_FIELD)]
|
|
5385
5327
|
});
|
|
5386
5328
|
} catch (error) {
|
|
5387
|
-
console.error(
|
|
5329
|
+
console.error("getJobType", error);
|
|
5388
5330
|
}
|
|
5389
5331
|
}));
|
|
5390
5332
|
_defineProperty(this, "getFieldTypeTitle", type => {
|
|
5391
5333
|
var fieldType = this.fieldTypes.find(f => f.Key === type);
|
|
5392
|
-
return fieldType ? fieldType.Title :
|
|
5334
|
+
return fieldType ? fieldType.Title : "";
|
|
5393
5335
|
});
|
|
5394
5336
|
_defineProperty(this, "validateEmail", () => {
|
|
5395
5337
|
var {
|
|
5396
5338
|
jobTypeEmail
|
|
5397
5339
|
} = this.state;
|
|
5398
|
-
return !_.isEmpty(jobTypeEmail) && Helper.isEmail(jobTypeEmail);
|
|
5340
|
+
return !_.isEmpty(jobTypeEmail) && Helper$1.isEmail(jobTypeEmail);
|
|
5399
5341
|
});
|
|
5400
5342
|
_defineProperty(this, "isJobTypeValid", () => {
|
|
5401
5343
|
var {
|
|
@@ -5410,7 +5352,7 @@ class AddJobType extends Component {
|
|
|
5410
5352
|
});
|
|
5411
5353
|
_defineProperty(this, "onHandleChange", event => {
|
|
5412
5354
|
var stateChange = {};
|
|
5413
|
-
stateChange[event.target.getAttribute(
|
|
5355
|
+
stateChange[event.target.getAttribute("id")] = event.target.value;
|
|
5414
5356
|
this.setState(stateChange);
|
|
5415
5357
|
});
|
|
5416
5358
|
_defineProperty(this, "onFieldTypeChanged", (fieldIndex, key) => {
|
|
@@ -5472,7 +5414,7 @@ class AddJobType extends Component {
|
|
|
5472
5414
|
});
|
|
5473
5415
|
_defineProperty(this, "onAddNewOption", fieldIndex => {
|
|
5474
5416
|
var customFields = [...this.state.customFields];
|
|
5475
|
-
customFields[fieldIndex].values.push(
|
|
5417
|
+
customFields[fieldIndex].values.push("");
|
|
5476
5418
|
this.setState({
|
|
5477
5419
|
customFields
|
|
5478
5420
|
});
|
|
@@ -5548,59 +5490,59 @@ class AddJobType extends Component {
|
|
|
5548
5490
|
success: true
|
|
5549
5491
|
});
|
|
5550
5492
|
} catch (error) {
|
|
5551
|
-
console.error(
|
|
5493
|
+
console.error("onSave", error);
|
|
5552
5494
|
_this.setState({
|
|
5553
5495
|
submitting: false
|
|
5554
5496
|
});
|
|
5555
|
-
alert(
|
|
5497
|
+
alert("Something went wrong with the request. Please try again.");
|
|
5556
5498
|
}
|
|
5557
5499
|
}));
|
|
5558
5500
|
});
|
|
5559
5501
|
this.fieldTypes = [{
|
|
5560
|
-
Title:
|
|
5561
|
-
Key:
|
|
5502
|
+
Title: "Text Input",
|
|
5503
|
+
Key: "text"
|
|
5562
5504
|
}, {
|
|
5563
|
-
Title:
|
|
5564
|
-
Key:
|
|
5505
|
+
Title: "Email Input",
|
|
5506
|
+
Key: "email"
|
|
5565
5507
|
}, {
|
|
5566
|
-
Title:
|
|
5567
|
-
Key:
|
|
5508
|
+
Title: "Phone Input",
|
|
5509
|
+
Key: "phone"
|
|
5568
5510
|
}, {
|
|
5569
|
-
Title:
|
|
5570
|
-
Key:
|
|
5511
|
+
Title: "Date Input",
|
|
5512
|
+
Key: "date"
|
|
5571
5513
|
}, {
|
|
5572
|
-
Title:
|
|
5573
|
-
Key:
|
|
5514
|
+
Title: "Time Input",
|
|
5515
|
+
Key: "time"
|
|
5574
5516
|
}, {
|
|
5575
|
-
Title:
|
|
5576
|
-
Key:
|
|
5517
|
+
Title: "Image Input",
|
|
5518
|
+
Key: "image"
|
|
5577
5519
|
},
|
|
5578
5520
|
// {
|
|
5579
5521
|
// Title: 'Document Input',
|
|
5580
5522
|
// Key: 'document',
|
|
5581
5523
|
// },
|
|
5582
5524
|
{
|
|
5583
|
-
Title:
|
|
5584
|
-
Key:
|
|
5525
|
+
Title: "Yes/No Question",
|
|
5526
|
+
Key: "yn"
|
|
5585
5527
|
}, {
|
|
5586
|
-
Title:
|
|
5587
|
-
Key:
|
|
5528
|
+
Title: "Multiple Choice",
|
|
5529
|
+
Key: "multichoice"
|
|
5588
5530
|
}, {
|
|
5589
|
-
Title:
|
|
5590
|
-
Key:
|
|
5531
|
+
Title: "Checkboxes",
|
|
5532
|
+
Key: "checkbox"
|
|
5591
5533
|
}, {
|
|
5592
|
-
Title:
|
|
5593
|
-
Key:
|
|
5534
|
+
Title: "Title Text",
|
|
5535
|
+
Key: "staticTitle"
|
|
5594
5536
|
}, {
|
|
5595
|
-
Title:
|
|
5596
|
-
Key:
|
|
5537
|
+
Title: "Paragraph Text",
|
|
5538
|
+
Key: "staticText"
|
|
5597
5539
|
}];
|
|
5598
5540
|
this.state = {
|
|
5599
5541
|
loading: false,
|
|
5600
|
-
jobTypeId: Helper.safeReadParams(this.props,
|
|
5601
|
-
jobTypeName:
|
|
5602
|
-
jobTypeEmail:
|
|
5603
|
-
jobTypeDescription:
|
|
5542
|
+
jobTypeId: Helper$1.safeReadParams(this.props, "jobTypeId") ? this.props.match.params.jobTypeId : null,
|
|
5543
|
+
jobTypeName: "",
|
|
5544
|
+
jobTypeEmail: "",
|
|
5545
|
+
jobTypeDescription: "",
|
|
5604
5546
|
hasCustomFields: false,
|
|
5605
5547
|
customFields: [_.cloneDeep(DEFAULT_FIELD)],
|
|
5606
5548
|
jobTypeLevel: 1,
|
|
@@ -5636,23 +5578,23 @@ class AddJobType extends Component {
|
|
|
5636
5578
|
mandatory,
|
|
5637
5579
|
isTitle
|
|
5638
5580
|
} = field;
|
|
5639
|
-
if ([
|
|
5581
|
+
if (["staticTitle", "staticText"].includes(type)) return;
|
|
5640
5582
|
if (_.isEmpty(label)) {
|
|
5641
5583
|
missingLabel = true;
|
|
5642
|
-
} else if (_.isEmpty(type) || (type ===
|
|
5584
|
+
} else if (_.isEmpty(type) || (type === "multichoice" || type === "checkbox") && (!values || values.length < 2 || !values.every(value => !_.isEmpty(value)))) {
|
|
5643
5585
|
warnings.push("'".concat(label, "' is incomplete"));
|
|
5644
5586
|
}
|
|
5645
5587
|
if (mandatory) hasMandatoryField = true;
|
|
5646
5588
|
if (isTitle) titleFieldCount += 1;
|
|
5647
5589
|
});
|
|
5648
5590
|
if (missingLabel) {
|
|
5649
|
-
warnings.push(
|
|
5591
|
+
warnings.push("All inputs must have a label");
|
|
5650
5592
|
}
|
|
5651
5593
|
if (!hasMandatoryField) {
|
|
5652
|
-
warnings.push(
|
|
5594
|
+
warnings.push("There must be at least one required input");
|
|
5653
5595
|
}
|
|
5654
5596
|
if (titleFieldCount > 1) {
|
|
5655
|
-
warnings.push(
|
|
5597
|
+
warnings.push("Only one required input can be selected as title for the request");
|
|
5656
5598
|
}
|
|
5657
5599
|
}
|
|
5658
5600
|
this.setState({
|
|
@@ -5686,7 +5628,7 @@ class AddJobType extends Component {
|
|
|
5686
5628
|
children: [/*#__PURE__*/jsxs(Components$1.Text, {
|
|
5687
5629
|
type: "formTitleLarge",
|
|
5688
5630
|
className: "marginBottom-24",
|
|
5689
|
-
children: [!jobTypeId ?
|
|
5631
|
+
children: [!jobTypeId ? "New" : "Edit", " ", values.textJobType]
|
|
5690
5632
|
}), /*#__PURE__*/jsx(Components$1.GenericInput, {
|
|
5691
5633
|
id: "jobTypeName",
|
|
5692
5634
|
type: "text",
|
|
@@ -5726,13 +5668,13 @@ class AddJobType extends Component {
|
|
|
5726
5668
|
label: "Do you want to create a custom form for this ".concat("".concat(values.textJobType), "?"),
|
|
5727
5669
|
isActive: hasCustomFields,
|
|
5728
5670
|
options: [{
|
|
5729
|
-
Label:
|
|
5671
|
+
Label: "Yes",
|
|
5730
5672
|
Value: true,
|
|
5731
5673
|
onChange: () => this.setState({
|
|
5732
5674
|
hasCustomFields: true
|
|
5733
5675
|
})
|
|
5734
5676
|
}, {
|
|
5735
|
-
Label:
|
|
5677
|
+
Label: "No",
|
|
5736
5678
|
Value: false,
|
|
5737
5679
|
onChange: () => this.setState({
|
|
5738
5680
|
hasCustomFields: false
|
|
@@ -5762,14 +5704,14 @@ class AddJobType extends Component {
|
|
|
5762
5704
|
className: "fieldInner",
|
|
5763
5705
|
children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
|
|
5764
5706
|
id: "fieldLabel".concat(fieldIndex),
|
|
5765
|
-
className:
|
|
5766
|
-
placeholder:
|
|
5707
|
+
className: "textInput",
|
|
5708
|
+
placeholder: "Type your label here (required)",
|
|
5767
5709
|
value: field.label,
|
|
5768
5710
|
onChange: e => this.onFieldLabelChanged(fieldIndex, e)
|
|
5769
5711
|
}), /*#__PURE__*/jsx(Components$1.GenericInput, {
|
|
5770
5712
|
id: "fieldPlaceHolder".concat(fieldIndex),
|
|
5771
|
-
className:
|
|
5772
|
-
placeholder:
|
|
5713
|
+
className: "placeHolderInput",
|
|
5714
|
+
placeholder: "Insert placeholder (optional)",
|
|
5773
5715
|
value: field.placeHolder,
|
|
5774
5716
|
onChange: e => this.onFieldPlaceHolderChanged(fieldIndex, e)
|
|
5775
5717
|
}), this.renderOptionalCheckBox(field, fieldIndex), this.renderTitleCheckBox(field, fieldIndex)]
|
|
@@ -5780,8 +5722,8 @@ class AddJobType extends Component {
|
|
|
5780
5722
|
className: "fieldInner",
|
|
5781
5723
|
children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
|
|
5782
5724
|
id: "fieldLabel".concat(fieldIndex),
|
|
5783
|
-
className:
|
|
5784
|
-
placeholder:
|
|
5725
|
+
className: "textInput",
|
|
5726
|
+
placeholder: "Type your label here (required)",
|
|
5785
5727
|
value: field.label,
|
|
5786
5728
|
onChange: e => this.onFieldLabelChanged(fieldIndex, e)
|
|
5787
5729
|
}), this.renderOptionalCheckBox(field, fieldIndex), this.renderTitleCheckBox(field, fieldIndex)]
|
|
@@ -5792,8 +5734,8 @@ class AddJobType extends Component {
|
|
|
5792
5734
|
className: "fieldInner",
|
|
5793
5735
|
children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
|
|
5794
5736
|
id: "fieldLabel".concat(fieldIndex),
|
|
5795
|
-
className:
|
|
5796
|
-
placeholder:
|
|
5737
|
+
className: "textInput",
|
|
5738
|
+
placeholder: "Type your label here (required)",
|
|
5797
5739
|
value: field.label,
|
|
5798
5740
|
onChange: e => this.onFieldLabelChanged(fieldIndex, e)
|
|
5799
5741
|
}), this.renderOptionalCheckBox(field, fieldIndex), this.renderTitleCheckBox(field, fieldIndex)]
|
|
@@ -5804,8 +5746,8 @@ class AddJobType extends Component {
|
|
|
5804
5746
|
className: "fieldInner",
|
|
5805
5747
|
children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
|
|
5806
5748
|
id: "fieldLabel".concat(fieldIndex),
|
|
5807
|
-
className:
|
|
5808
|
-
placeholder:
|
|
5749
|
+
className: "textInput",
|
|
5750
|
+
placeholder: "Type your label here (required)",
|
|
5809
5751
|
value: field.label,
|
|
5810
5752
|
onChange: e => this.onFieldLabelChanged(fieldIndex, e)
|
|
5811
5753
|
}), this.renderOptionalCheckBox(field, fieldIndex)]
|
|
@@ -5816,8 +5758,8 @@ class AddJobType extends Component {
|
|
|
5816
5758
|
className: "fieldInner",
|
|
5817
5759
|
children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
|
|
5818
5760
|
id: "fieldLabel".concat(fieldIndex),
|
|
5819
|
-
className:
|
|
5820
|
-
placeholder:
|
|
5761
|
+
className: "textInput",
|
|
5762
|
+
placeholder: "Type your label here (required)",
|
|
5821
5763
|
value: field.label,
|
|
5822
5764
|
onChange: e => this.onFieldLabelChanged(fieldIndex, e)
|
|
5823
5765
|
}), this.renderOptionalCheckBox(field, fieldIndex)]
|
|
@@ -5828,8 +5770,8 @@ class AddJobType extends Component {
|
|
|
5828
5770
|
className: "fieldInner",
|
|
5829
5771
|
children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
|
|
5830
5772
|
id: "fieldLabel".concat(fieldIndex),
|
|
5831
|
-
className:
|
|
5832
|
-
placeholder:
|
|
5773
|
+
className: "textInput",
|
|
5774
|
+
placeholder: "Type your label here (required)",
|
|
5833
5775
|
value: field.label,
|
|
5834
5776
|
onChange: e => this.onFieldLabelChanged(fieldIndex, e)
|
|
5835
5777
|
}), /*#__PURE__*/jsxs(Table, {
|
|
@@ -5845,7 +5787,7 @@ class AddJobType extends Component {
|
|
|
5845
5787
|
})]
|
|
5846
5788
|
})
|
|
5847
5789
|
}), /*#__PURE__*/jsx("tbody", {
|
|
5848
|
-
children: [
|
|
5790
|
+
children: ["Yes", "No"].map((value, optionIndex) => {
|
|
5849
5791
|
return /*#__PURE__*/jsxs("tr", {
|
|
5850
5792
|
className: "option",
|
|
5851
5793
|
children: [/*#__PURE__*/jsx("td", {
|
|
@@ -5875,8 +5817,8 @@ class AddJobType extends Component {
|
|
|
5875
5817
|
className: "fieldInner",
|
|
5876
5818
|
children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
|
|
5877
5819
|
id: "fieldLabel".concat(fieldIndex),
|
|
5878
|
-
className:
|
|
5879
|
-
placeholder:
|
|
5820
|
+
className: "textInput",
|
|
5821
|
+
placeholder: "Type your label here (required)",
|
|
5880
5822
|
value: field.label,
|
|
5881
5823
|
onChange: e => this.onFieldLabelChanged(fieldIndex, e)
|
|
5882
5824
|
}), /*#__PURE__*/jsxs(Table, {
|
|
@@ -5906,15 +5848,15 @@ class AddJobType extends Component {
|
|
|
5906
5848
|
}), /*#__PURE__*/jsx("td", {
|
|
5907
5849
|
children: /*#__PURE__*/jsx(Components$1.GenericInput, {
|
|
5908
5850
|
id: "fieldOption".concat(optionIndex),
|
|
5909
|
-
placeholder:
|
|
5851
|
+
placeholder: "Enter option",
|
|
5910
5852
|
value: value,
|
|
5911
5853
|
onChange: e => this.onFieldOptionChanged(fieldIndex, optionIndex, e)
|
|
5912
5854
|
})
|
|
5913
5855
|
}), /*#__PURE__*/jsx("td", {
|
|
5914
5856
|
children: customFields[fieldIndex].values.length > 1 ? /*#__PURE__*/jsx("div", {
|
|
5915
5857
|
onClick: () => this.onRemoveOption(fieldIndex, optionIndex),
|
|
5916
|
-
children: /*#__PURE__*/jsx(
|
|
5917
|
-
|
|
5858
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
5859
|
+
icon: "circle-minus",
|
|
5918
5860
|
className: "cornerCancelButton_icon"
|
|
5919
5861
|
})
|
|
5920
5862
|
}) : null
|
|
@@ -5925,9 +5867,9 @@ class AddJobType extends Component {
|
|
|
5925
5867
|
}), /*#__PURE__*/jsxs("div", {
|
|
5926
5868
|
className: "clearfix addoption optionAdd marginBottom-10",
|
|
5927
5869
|
onClick: () => this.onAddNewOption(fieldIndex),
|
|
5928
|
-
children: [/*#__PURE__*/jsx(
|
|
5870
|
+
children: [/*#__PURE__*/jsx(Icon, {
|
|
5929
5871
|
className: "addoption_plus",
|
|
5930
|
-
icon: "
|
|
5872
|
+
icon: "circle-plus"
|
|
5931
5873
|
}), /*#__PURE__*/jsx("div", {
|
|
5932
5874
|
className: "fillSpace",
|
|
5933
5875
|
children: /*#__PURE__*/jsx("p", {
|
|
@@ -5946,8 +5888,8 @@ class AddJobType extends Component {
|
|
|
5946
5888
|
className: "fieldInner",
|
|
5947
5889
|
children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
|
|
5948
5890
|
id: "fieldLabel".concat(fieldIndex),
|
|
5949
|
-
className:
|
|
5950
|
-
placeholder:
|
|
5891
|
+
className: "textInput",
|
|
5892
|
+
placeholder: "Type your label here (required)",
|
|
5951
5893
|
value: field.label,
|
|
5952
5894
|
onChange: e => this.onFieldLabelChanged(fieldIndex, e)
|
|
5953
5895
|
}), /*#__PURE__*/jsxs(Table, {
|
|
@@ -5977,15 +5919,15 @@ class AddJobType extends Component {
|
|
|
5977
5919
|
}), /*#__PURE__*/jsx("td", {
|
|
5978
5920
|
children: /*#__PURE__*/jsx(Components$1.GenericInput, {
|
|
5979
5921
|
id: "fieldOption".concat(optionIndex),
|
|
5980
|
-
placeholder:
|
|
5922
|
+
placeholder: "Enter option",
|
|
5981
5923
|
value: value,
|
|
5982
5924
|
onChange: e => this.onFieldOptionChanged(fieldIndex, optionIndex, e)
|
|
5983
5925
|
})
|
|
5984
5926
|
}), /*#__PURE__*/jsx("td", {
|
|
5985
5927
|
children: customFields[fieldIndex].values.length > 1 ? /*#__PURE__*/jsx("div", {
|
|
5986
5928
|
onClick: () => this.onRemoveOption(fieldIndex, optionIndex),
|
|
5987
|
-
children: /*#__PURE__*/jsx(
|
|
5988
|
-
|
|
5929
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
5930
|
+
icon: "circle-minus",
|
|
5989
5931
|
className: "cornerCancelButton_icon"
|
|
5990
5932
|
})
|
|
5991
5933
|
}) : null
|
|
@@ -5996,9 +5938,9 @@ class AddJobType extends Component {
|
|
|
5996
5938
|
}), /*#__PURE__*/jsxs("div", {
|
|
5997
5939
|
className: "clearfix addoption optionAdd marginBottom-10",
|
|
5998
5940
|
onClick: () => this.onAddNewOption(fieldIndex),
|
|
5999
|
-
children: [/*#__PURE__*/jsx(
|
|
5941
|
+
children: [/*#__PURE__*/jsx(Icon, {
|
|
6000
5942
|
className: "addoption_plus",
|
|
6001
|
-
icon: "
|
|
5943
|
+
icon: "circle-plus"
|
|
6002
5944
|
}), /*#__PURE__*/jsx("div", {
|
|
6003
5945
|
className: "fillSpace",
|
|
6004
5946
|
children: /*#__PURE__*/jsx("p", {
|
|
@@ -6039,27 +5981,27 @@ class AddJobType extends Component {
|
|
|
6039
5981
|
} = this.state;
|
|
6040
5982
|
var renderFieldContent = () => {
|
|
6041
5983
|
switch (field.type) {
|
|
6042
|
-
case
|
|
6043
|
-
case
|
|
6044
|
-
case
|
|
5984
|
+
case "text":
|
|
5985
|
+
case "email":
|
|
5986
|
+
case "phone":
|
|
6045
5987
|
return this.renderFieldText(field, fieldIndex);
|
|
6046
|
-
case
|
|
5988
|
+
case "date":
|
|
6047
5989
|
return this.renderFieldDate(field, fieldIndex);
|
|
6048
|
-
case
|
|
5990
|
+
case "time":
|
|
6049
5991
|
return this.renderFieldTime(field, fieldIndex);
|
|
6050
|
-
case
|
|
5992
|
+
case "image":
|
|
6051
5993
|
return this.renderFieldImage(field, fieldIndex);
|
|
6052
|
-
case
|
|
5994
|
+
case "document":
|
|
6053
5995
|
return this.renderFieldDocument(field, fieldIndex);
|
|
6054
|
-
case
|
|
5996
|
+
case "yn":
|
|
6055
5997
|
return this.renderFieldYesNo(field, fieldIndex);
|
|
6056
|
-
case
|
|
5998
|
+
case "multichoice":
|
|
6057
5999
|
return this.renderFieldMultiple(field, fieldIndex);
|
|
6058
|
-
case
|
|
6000
|
+
case "checkbox":
|
|
6059
6001
|
return this.renderFieldCheckbox(field, fieldIndex);
|
|
6060
|
-
case
|
|
6002
|
+
case "staticTitle":
|
|
6061
6003
|
return this.renderFieldStaticTitle(field, fieldIndex);
|
|
6062
|
-
case
|
|
6004
|
+
case "staticText":
|
|
6063
6005
|
return this.renderFieldStaticText(field, fieldIndex);
|
|
6064
6006
|
default:
|
|
6065
6007
|
return null;
|
|
@@ -6105,15 +6047,15 @@ class AddJobType extends Component {
|
|
|
6105
6047
|
children: [fieldIndex > 0 ? /*#__PURE__*/jsx("div", {
|
|
6106
6048
|
className: "circle",
|
|
6107
6049
|
onClick: () => this.onMoveFieldPrev(fieldIndex),
|
|
6108
|
-
children: /*#__PURE__*/jsx(
|
|
6109
|
-
|
|
6050
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
6051
|
+
icon: "angle-up",
|
|
6110
6052
|
className: "icon"
|
|
6111
6053
|
})
|
|
6112
6054
|
}) : null, fieldIndex < customFields.length - 1 ? /*#__PURE__*/jsx("div", {
|
|
6113
6055
|
className: "circle",
|
|
6114
6056
|
onClick: () => this.onMoveFieldNext(fieldIndex),
|
|
6115
|
-
children: /*#__PURE__*/jsx(
|
|
6116
|
-
|
|
6057
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
6058
|
+
icon: "angle-down",
|
|
6117
6059
|
className: "icon"
|
|
6118
6060
|
})
|
|
6119
6061
|
}) : null]
|
|
@@ -6133,7 +6075,7 @@ class AddJobType extends Component {
|
|
|
6133
6075
|
type: "bodyLarge",
|
|
6134
6076
|
className: "marginBottom-24 paddingLeft-40",
|
|
6135
6077
|
style: {
|
|
6136
|
-
color: Colours$
|
|
6078
|
+
color: Colours$4.COLOUR_LIGHTGREY
|
|
6137
6079
|
},
|
|
6138
6080
|
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."
|
|
6139
6081
|
}), /*#__PURE__*/jsxs("div", {
|
|
@@ -6141,9 +6083,9 @@ class AddJobType extends Component {
|
|
|
6141
6083
|
children: [customFields.map((field, fieldIndex) => this.renderField(field, fieldIndex)), /*#__PURE__*/jsxs("div", {
|
|
6142
6084
|
className: "clearfix addoption addField",
|
|
6143
6085
|
onClick: () => this.onAddNewField(),
|
|
6144
|
-
children: [/*#__PURE__*/jsx(
|
|
6086
|
+
children: [/*#__PURE__*/jsx(Icon, {
|
|
6145
6087
|
className: "addoption_plus",
|
|
6146
|
-
icon: "
|
|
6088
|
+
icon: "circle-plus"
|
|
6147
6089
|
}), /*#__PURE__*/jsx("div", {
|
|
6148
6090
|
className: "fillSpace",
|
|
6149
6091
|
children: /*#__PURE__*/jsx("p", {
|
|
@@ -6164,10 +6106,10 @@ class AddJobType extends Component {
|
|
|
6164
6106
|
return /*#__PURE__*/jsxs("div", {
|
|
6165
6107
|
className: "padding-60 paddingVertical-8 text-bodyLarge",
|
|
6166
6108
|
style: {
|
|
6167
|
-
color: Colours$
|
|
6109
|
+
color: Colours$4.COLOUR_RED
|
|
6168
6110
|
},
|
|
6169
6111
|
children: ["To save the form", /*#__PURE__*/jsx("ul", {
|
|
6170
|
-
|
|
6112
|
+
iconStyle: {
|
|
6171
6113
|
padding: 0,
|
|
6172
6114
|
paddingLeft: 16
|
|
6173
6115
|
},
|
|
@@ -6184,11 +6126,11 @@ class AddJobType extends Component {
|
|
|
6184
6126
|
} = this.state;
|
|
6185
6127
|
if (!success) return null;
|
|
6186
6128
|
return /*#__PURE__*/jsx(Components$1.SuccessPopup, {
|
|
6187
|
-
text: "".concat("".concat(values.textJobType), " has been ", !jobTypeId ?
|
|
6129
|
+
text: "".concat("".concat(values.textJobType), " has been ", !jobTypeId ? "added" : "edited"),
|
|
6188
6130
|
buttons: [{
|
|
6189
|
-
type:
|
|
6131
|
+
type: "outlined",
|
|
6190
6132
|
onClick: this.onBack,
|
|
6191
|
-
text:
|
|
6133
|
+
text: "Go to home"
|
|
6192
6134
|
}]
|
|
6193
6135
|
});
|
|
6194
6136
|
}
|
|
@@ -6251,10 +6193,14 @@ var AddJobType$1 = connect(mapStateToProps$1, {
|
|
|
6251
6193
|
jobTypesUpdate
|
|
6252
6194
|
})(withRouter(AddJobType));
|
|
6253
6195
|
|
|
6196
|
+
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; }
|
|
6197
|
+
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; }
|
|
6254
6198
|
var {
|
|
6255
6199
|
Analytics: Analytics$1,
|
|
6256
6200
|
Session,
|
|
6257
|
-
Components
|
|
6201
|
+
Components,
|
|
6202
|
+
Helper,
|
|
6203
|
+
Colours
|
|
6258
6204
|
} = PlussCore;
|
|
6259
6205
|
var getInitialState = () => ({
|
|
6260
6206
|
requests: 0,
|
|
@@ -6274,10 +6220,21 @@ var AnalyticsHub = _ref => {
|
|
|
6274
6220
|
auth,
|
|
6275
6221
|
prevText,
|
|
6276
6222
|
dayCount,
|
|
6277
|
-
strings
|
|
6223
|
+
strings,
|
|
6224
|
+
userType,
|
|
6225
|
+
userCategory,
|
|
6226
|
+
selectedSites
|
|
6278
6227
|
} = _ref;
|
|
6279
6228
|
var [analyticsData, setAnalyticsData] = useState(getInitialState());
|
|
6280
6229
|
var [isExportOpen, setIsExportOpen] = useState(false);
|
|
6230
|
+
var [failedSites, setFailedSites] = useState([]);
|
|
6231
|
+
var [comparisonData, setComparisonData] = useState({
|
|
6232
|
+
requests: [],
|
|
6233
|
+
completedRequests: [],
|
|
6234
|
+
comments: [],
|
|
6235
|
+
isLoading: true
|
|
6236
|
+
});
|
|
6237
|
+
var comparisonMode = selectedSites && selectedSites.length > 1;
|
|
6281
6238
|
var hasAccess = Session.validateAccess(auth.site, values.permissionMaintenanceTracking, auth);
|
|
6282
6239
|
if (!hasAccess) {
|
|
6283
6240
|
return null;
|
|
@@ -6289,55 +6246,140 @@ var AnalyticsHub = _ref => {
|
|
|
6289
6246
|
return strings.sideNav[key];
|
|
6290
6247
|
})();
|
|
6291
6248
|
var exportColumns = [{
|
|
6292
|
-
label:
|
|
6293
|
-
key:
|
|
6294
|
-
}, {
|
|
6295
|
-
label:
|
|
6296
|
-
key:
|
|
6249
|
+
label: "Select All",
|
|
6250
|
+
key: ""
|
|
6251
|
+
}, ...(comparisonMode ? [{
|
|
6252
|
+
label: "Site",
|
|
6253
|
+
key: "site"
|
|
6254
|
+
}] : []), {
|
|
6255
|
+
label: "Start Date",
|
|
6256
|
+
key: "startDate"
|
|
6297
6257
|
}, {
|
|
6298
|
-
label:
|
|
6299
|
-
key:
|
|
6258
|
+
label: "End Date",
|
|
6259
|
+
key: "endDate"
|
|
6300
6260
|
}, {
|
|
6301
6261
|
label: "".concat(values.textSingularName, "s"),
|
|
6302
|
-
key:
|
|
6262
|
+
key: "requests"
|
|
6303
6263
|
}, {
|
|
6304
6264
|
label: "Completed ".concat(values.textSingularName, "s"),
|
|
6305
|
-
key:
|
|
6265
|
+
key: "completedRequests"
|
|
6306
6266
|
}, {
|
|
6307
|
-
label:
|
|
6308
|
-
key:
|
|
6267
|
+
label: "Comments",
|
|
6268
|
+
key: "comments"
|
|
6309
6269
|
}];
|
|
6310
6270
|
useEffect(() => {
|
|
6311
6271
|
getData();
|
|
6312
|
-
}, [startTime, endTime]);
|
|
6272
|
+
}, [startTime, endTime, userType, userCategory, selectedSites]);
|
|
6313
6273
|
var getData = /*#__PURE__*/function () {
|
|
6314
6274
|
var _ref2 = _asyncToGenerator(function* () {
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6275
|
+
try {
|
|
6276
|
+
setFailedSites([]);
|
|
6277
|
+
if (comparisonMode) {
|
|
6278
|
+
setComparisonData({
|
|
6279
|
+
requests: [],
|
|
6280
|
+
completedRequests: [],
|
|
6281
|
+
comments: [],
|
|
6282
|
+
isLoading: true
|
|
6283
|
+
});
|
|
6284
|
+
var multiSiteResultsObj = yield Analytics$1.fetchMultiSiteData(selectedSites, /*#__PURE__*/function () {
|
|
6285
|
+
var _ref3 = _asyncToGenerator(function* (site) {
|
|
6286
|
+
var {
|
|
6287
|
+
data
|
|
6288
|
+
} = yield analyticsActions.getAggregateEntityStats(site, values.analyticsKey, startTime, endTime, true, {
|
|
6289
|
+
userType,
|
|
6290
|
+
userCategory
|
|
6291
|
+
});
|
|
6292
|
+
return data;
|
|
6293
|
+
});
|
|
6294
|
+
return function (_x) {
|
|
6295
|
+
return _ref3.apply(this, arguments);
|
|
6296
|
+
};
|
|
6297
|
+
}());
|
|
6298
|
+
var roles = auth.user.Roles;
|
|
6299
|
+
var failed = Object.entries(multiSiteResultsObj).filter(_ref4 => {
|
|
6300
|
+
var [, data] = _ref4;
|
|
6301
|
+
return data === null;
|
|
6302
|
+
}).map(_ref5 => {
|
|
6303
|
+
var [site] = _ref5;
|
|
6304
|
+
return Helper.getSiteNameFromRoles(site, roles);
|
|
6305
|
+
});
|
|
6306
|
+
setFailedSites(failed);
|
|
6307
|
+
var multiSiteResults = Object.entries(multiSiteResultsObj).filter(_ref6 => {
|
|
6308
|
+
var [, data] = _ref6;
|
|
6309
|
+
return data !== null;
|
|
6310
|
+
}).map(_ref7 => {
|
|
6311
|
+
var [site, data] = _ref7;
|
|
6312
|
+
return {
|
|
6313
|
+
site,
|
|
6314
|
+
data
|
|
6315
|
+
};
|
|
6316
|
+
});
|
|
6317
|
+
var buildComparison = (activityKey, countType) => multiSiteResults.map(result => ({
|
|
6318
|
+
name: Helper.getSiteNameFromRoles(result.site, roles),
|
|
6319
|
+
value: Analytics$1.countActivities(result.data, activityKey, countType)
|
|
6320
|
+
}));
|
|
6321
|
+
setComparisonData({
|
|
6322
|
+
requests: buildComparison("Request", "total"),
|
|
6323
|
+
completedRequests: buildComparison("RequestCompleted", "unique"),
|
|
6324
|
+
comments: buildComparison("Comment", "total"),
|
|
6325
|
+
isLoading: false
|
|
6326
|
+
});
|
|
6327
|
+
} else {
|
|
6328
|
+
setAnalyticsData(getInitialState());
|
|
6329
|
+
var site = selectedSites && selectedSites.length === 1 ? selectedSites[0] : auth.site;
|
|
6330
|
+
var timeDifference = endTime - startTime;
|
|
6331
|
+
var [currentStatsResponse, prevStatsResponse] = yield Promise.all([analyticsActions.getAggregateEntityStats(site, values.analyticsKey, startTime, endTime, true, {
|
|
6332
|
+
userType,
|
|
6333
|
+
userCategory
|
|
6334
|
+
}), analyticsActions.getAggregateEntityStats(site, values.analyticsKey, startTime - timeDifference, startTime, true, {
|
|
6335
|
+
userType,
|
|
6336
|
+
userCategory
|
|
6337
|
+
})]);
|
|
6338
|
+
var data = {
|
|
6339
|
+
requests: Analytics$1.countActivities(currentStatsResponse.data, "Request", "total"),
|
|
6340
|
+
prevRequests: Analytics$1.countActivities(prevStatsResponse.data, "Request", "total"),
|
|
6341
|
+
completedRequests: Analytics$1.countActivities(currentStatsResponse.data, "RequestCompleted", "unique"),
|
|
6342
|
+
prevCompletedRequests: Analytics$1.countActivities(prevStatsResponse.data, "RequestCompleted", "unique"),
|
|
6343
|
+
comments: Analytics$1.countActivities(currentStatsResponse.data, "Comment", "total"),
|
|
6344
|
+
prevComments: Analytics$1.countActivities(prevStatsResponse.data, "Comment", "total"),
|
|
6345
|
+
isLoading: false
|
|
6346
|
+
};
|
|
6347
|
+
setAnalyticsData(data);
|
|
6348
|
+
}
|
|
6349
|
+
} catch (err) {
|
|
6350
|
+
if (comparisonMode) {
|
|
6351
|
+
setComparisonData(prev => _objectSpread$3(_objectSpread$3({}, prev), {}, {
|
|
6352
|
+
isLoading: false
|
|
6353
|
+
}));
|
|
6354
|
+
} else {
|
|
6355
|
+
setAnalyticsData(prev => _objectSpread$3(_objectSpread$3({}, prev), {}, {
|
|
6356
|
+
isLoading: false
|
|
6357
|
+
}));
|
|
6358
|
+
}
|
|
6359
|
+
}
|
|
6329
6360
|
});
|
|
6330
6361
|
return function getData() {
|
|
6331
6362
|
return _ref2.apply(this, arguments);
|
|
6332
6363
|
};
|
|
6333
6364
|
}();
|
|
6334
6365
|
var isReadyToOpenCSV = () => {
|
|
6335
|
-
return !analyticsData.isLoading;
|
|
6366
|
+
return comparisonMode ? !comparisonData.isLoading : !analyticsData.isLoading;
|
|
6336
6367
|
};
|
|
6337
6368
|
var getExportSource = () => {
|
|
6369
|
+
if (comparisonMode) {
|
|
6370
|
+
var sites = comparisonData.requests || [];
|
|
6371
|
+
return sites.map((site, i) => ({
|
|
6372
|
+
site: site.name,
|
|
6373
|
+
startDate: moment(startTime + 1).format("D-MM-YYYY"),
|
|
6374
|
+
endDate: moment(endTime).format("D-MM-YYYY"),
|
|
6375
|
+
requests: site.value,
|
|
6376
|
+
completedRequests: comparisonData.completedRequests[i] && comparisonData.completedRequests[i].value || 0,
|
|
6377
|
+
comments: comparisonData.comments[i] && comparisonData.comments[i].value || 0
|
|
6378
|
+
}));
|
|
6379
|
+
}
|
|
6338
6380
|
return [{
|
|
6339
|
-
startDate: moment(startTime + 1).format(
|
|
6340
|
-
endDate: moment(endTime).format(
|
|
6381
|
+
startDate: moment(startTime + 1).format("D-MM-YYYY"),
|
|
6382
|
+
endDate: moment(endTime).format("D-MM-YYYY"),
|
|
6341
6383
|
requests: analyticsData.requests,
|
|
6342
6384
|
completedRequests: analyticsData.completedRequests,
|
|
6343
6385
|
comments: analyticsData.comments
|
|
@@ -6348,13 +6390,14 @@ var AnalyticsHub = _ref => {
|
|
|
6348
6390
|
return null;
|
|
6349
6391
|
}
|
|
6350
6392
|
var source = getExportSource();
|
|
6393
|
+
var filterSuffix = [userType, userCategory].filter(Boolean).map(f => f.toLowerCase().replace(/\s+/g, "-")).join("_");
|
|
6351
6394
|
return /*#__PURE__*/jsx(Components.ExportCsvPopup, {
|
|
6352
6395
|
onClose: () => {
|
|
6353
6396
|
setIsExportOpen(false);
|
|
6354
6397
|
},
|
|
6355
6398
|
columns: exportColumns,
|
|
6356
6399
|
source: source,
|
|
6357
|
-
filename: "".concat(values.analyticsKey, "
|
|
6400
|
+
filename: "".concat(values.analyticsKey, "analytics").concat(comparisonMode ? "_comparison" : "").concat(filterSuffix ? "_".concat(filterSuffix) : "", "_").concat(source[0].startDate, "_").concat(source[0].endDate, ".csv")
|
|
6358
6401
|
});
|
|
6359
6402
|
};
|
|
6360
6403
|
return /*#__PURE__*/jsxs("div", {
|
|
@@ -6372,36 +6415,76 @@ var AnalyticsHub = _ref => {
|
|
|
6372
6415
|
setIsExportOpen(true);
|
|
6373
6416
|
},
|
|
6374
6417
|
isActive: isReadyToOpenCSV(),
|
|
6375
|
-
leftIcon: "file-code
|
|
6418
|
+
leftIcon: "file-code",
|
|
6376
6419
|
children: "Export CSV"
|
|
6377
6420
|
})]
|
|
6378
|
-
}), /*#__PURE__*/jsxs(
|
|
6421
|
+
}), failedSites.length > 0 && /*#__PURE__*/jsxs(Components.Text, {
|
|
6422
|
+
type: "help",
|
|
6423
|
+
style: {
|
|
6424
|
+
color: Colours.COLOUR_RED,
|
|
6425
|
+
marginTop: 8
|
|
6426
|
+
},
|
|
6427
|
+
children: ["Data unavailable for: ", failedSites.join(", ")]
|
|
6428
|
+
}), /*#__PURE__*/jsx("div", {
|
|
6379
6429
|
className: "analyticsSection dashboardSection_content",
|
|
6380
|
-
children:
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6430
|
+
children: (() => {
|
|
6431
|
+
var chartSuffix = [selectedSites && selectedSites.length > 0 ? "&sites=".concat(selectedSites.join(",")) : "", userType ? "&userType=".concat(encodeURIComponent(userType)) : "", userCategory ? "&userCategory=".concat(encodeURIComponent(userCategory)) : ""].join("");
|
|
6432
|
+
if (comparisonMode) {
|
|
6433
|
+
return /*#__PURE__*/jsxs("div", {
|
|
6434
|
+
style: {
|
|
6435
|
+
display: "flex",
|
|
6436
|
+
flexDirection: "column",
|
|
6437
|
+
gap: 16
|
|
6438
|
+
},
|
|
6439
|
+
children: [/*#__PURE__*/jsx(Components.ComparisonStatBox, {
|
|
6440
|
+
title: "".concat(featureTitle, " Requests"),
|
|
6441
|
+
data: comparisonData.requests,
|
|
6442
|
+
prevText: prevText,
|
|
6443
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Request&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
6444
|
+
isLoading: comparisonData.isLoading
|
|
6445
|
+
}), /*#__PURE__*/jsx(Components.ComparisonStatBox, {
|
|
6446
|
+
title: "Completed ".concat(featureTitle, " Requests"),
|
|
6447
|
+
data: comparisonData.completedRequests,
|
|
6448
|
+
prevText: prevText,
|
|
6449
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=RequestCompleted&countType=unique&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
6450
|
+
isLoading: comparisonData.isLoading
|
|
6451
|
+
}), /*#__PURE__*/jsx(Components.ComparisonStatBox, {
|
|
6452
|
+
title: "".concat(featureTitle, " Comments"),
|
|
6453
|
+
data: comparisonData.comments,
|
|
6454
|
+
prevText: prevText,
|
|
6455
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Comment&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
6456
|
+
isLoading: comparisonData.isLoading
|
|
6457
|
+
})]
|
|
6458
|
+
});
|
|
6459
|
+
}
|
|
6460
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
6461
|
+
children: [/*#__PURE__*/jsx(Components.StatBox, {
|
|
6462
|
+
title: "".concat(featureTitle, " Requests"),
|
|
6463
|
+
icon: "wrench",
|
|
6464
|
+
value: analyticsData.requests,
|
|
6465
|
+
previousValue: analyticsData.prevRequests,
|
|
6466
|
+
prevText: prevText,
|
|
6467
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Request&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
6468
|
+
isLoading: analyticsData.isLoading
|
|
6469
|
+
}), /*#__PURE__*/jsx(Components.StatBox, {
|
|
6470
|
+
title: "Completed ".concat(featureTitle, " Requests"),
|
|
6471
|
+
icon: "circle-check",
|
|
6472
|
+
value: analyticsData.completedRequests,
|
|
6473
|
+
previousValue: analyticsData.prevCompletedRequests,
|
|
6474
|
+
prevText: prevText,
|
|
6475
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=RequestCompleted&countType=unique&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
6476
|
+
isLoading: analyticsData.isLoading
|
|
6477
|
+
}), /*#__PURE__*/jsx(Components.StatBox, {
|
|
6478
|
+
title: "".concat(featureTitle, " Comments"),
|
|
6479
|
+
icon: "comment",
|
|
6480
|
+
value: analyticsData.comments,
|
|
6481
|
+
previousValue: analyticsData.prevComments,
|
|
6482
|
+
prevText: prevText,
|
|
6483
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Comment&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
6484
|
+
isLoading: analyticsData.isLoading
|
|
6485
|
+
})]
|
|
6486
|
+
});
|
|
6487
|
+
})()
|
|
6405
6488
|
})]
|
|
6406
6489
|
});
|
|
6407
6490
|
};
|
|
@@ -6434,19 +6517,15 @@ var MaintenanceReducer = (function () {
|
|
|
6434
6517
|
loading: true
|
|
6435
6518
|
});
|
|
6436
6519
|
case JOBS_LOADED:
|
|
6520
|
+
var result = _.unionWith(action.payload, state.jobs, (v1, v2) => {
|
|
6521
|
+
return v1 != null && v2 != null && v1.id === v2.id;
|
|
6522
|
+
});
|
|
6437
6523
|
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
6438
|
-
jobs:
|
|
6524
|
+
jobs: result.map(job => _objectSpread$2({
|
|
6439
6525
|
title: job.title || job.description
|
|
6440
6526
|
}, job)),
|
|
6441
6527
|
loading: false
|
|
6442
6528
|
});
|
|
6443
|
-
case JOBS_ADDED:
|
|
6444
|
-
var added = _.unionWith(action.payload.map(job => _objectSpread$2({
|
|
6445
|
-
title: job.title || job.description
|
|
6446
|
-
}, job)), state.jobs, (v1, v2) => v1 != null && v2 != null && v1.id === v2.id);
|
|
6447
|
-
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
6448
|
-
jobs: added
|
|
6449
|
-
});
|
|
6450
6529
|
case JOBS_REMOVED:
|
|
6451
6530
|
var index = _.findIndex(state.jobs, event => {
|
|
6452
6531
|
return event != null && event.id === action.payload;
|
|
@@ -6467,7 +6546,7 @@ var MaintenanceReducer = (function () {
|
|
|
6467
6546
|
jobtypes
|
|
6468
6547
|
});
|
|
6469
6548
|
case JOBS_STATUSES_LOADED:
|
|
6470
|
-
var jobstatuses = _.orderBy(action.payload,
|
|
6549
|
+
var jobstatuses = _.orderBy(action.payload, "order", "asc");
|
|
6471
6550
|
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
6472
6551
|
jobstatuses
|
|
6473
6552
|
});
|
|
@@ -6500,7 +6579,7 @@ class ActivityText extends Component {
|
|
|
6500
6579
|
className: clickableClasses,
|
|
6501
6580
|
children: _.truncate(data.Data.title || data.Data.description, {
|
|
6502
6581
|
length: 30,
|
|
6503
|
-
separator:
|
|
6582
|
+
separator: "..."
|
|
6504
6583
|
})
|
|
6505
6584
|
})]
|
|
6506
6585
|
});
|
|
@@ -6515,7 +6594,7 @@ class ActivityText extends Component {
|
|
|
6515
6594
|
className: clickableClasses,
|
|
6516
6595
|
children: _.truncate(data.Data.title || data.Data.description, {
|
|
6517
6596
|
length: 30,
|
|
6518
|
-
separator:
|
|
6597
|
+
separator: "..."
|
|
6519
6598
|
})
|
|
6520
6599
|
})]
|
|
6521
6600
|
});
|
|
@@ -6530,7 +6609,7 @@ class ActivityText extends Component {
|
|
|
6530
6609
|
className: clickableClasses,
|
|
6531
6610
|
children: _.truncate(data.Data.title || data.Data.description, {
|
|
6532
6611
|
length: 30,
|
|
6533
|
-
separator:
|
|
6612
|
+
separator: "..."
|
|
6534
6613
|
})
|
|
6535
6614
|
})]
|
|
6536
6615
|
});
|
|
@@ -6544,7 +6623,7 @@ class ActivityText extends Component {
|
|
|
6544
6623
|
className: highlightedClasses,
|
|
6545
6624
|
children: _.truncate(data.Data.title || data.Data.description, {
|
|
6546
6625
|
length: 30,
|
|
6547
|
-
separator:
|
|
6626
|
+
separator: "..."
|
|
6548
6627
|
})
|
|
6549
6628
|
})]
|
|
6550
6629
|
});
|
|
@@ -6586,9 +6665,9 @@ class ViewFull extends Component {
|
|
|
6586
6665
|
}
|
|
6587
6666
|
var styles$2 = {
|
|
6588
6667
|
image: {
|
|
6589
|
-
width:
|
|
6590
|
-
height:
|
|
6591
|
-
objectFit:
|
|
6668
|
+
width: "100%",
|
|
6669
|
+
height: "100%",
|
|
6670
|
+
objectFit: "contain"
|
|
6592
6671
|
}
|
|
6593
6672
|
};
|
|
6594
6673
|
|
|
@@ -6622,10 +6701,10 @@ class PreviewWidget extends Component {
|
|
|
6622
6701
|
}
|
|
6623
6702
|
var styles$1 = {
|
|
6624
6703
|
container: {
|
|
6625
|
-
position:
|
|
6704
|
+
position: "relative"
|
|
6626
6705
|
},
|
|
6627
6706
|
image: {
|
|
6628
|
-
width:
|
|
6707
|
+
width: "100%"
|
|
6629
6708
|
}
|
|
6630
6709
|
};
|
|
6631
6710
|
|
|
@@ -6658,10 +6737,10 @@ class PreviewFull extends Component {
|
|
|
6658
6737
|
}
|
|
6659
6738
|
var styles = {
|
|
6660
6739
|
container: {
|
|
6661
|
-
position:
|
|
6740
|
+
position: "relative"
|
|
6662
6741
|
},
|
|
6663
6742
|
image: {
|
|
6664
|
-
width:
|
|
6743
|
+
width: "100%"
|
|
6665
6744
|
}
|
|
6666
6745
|
};
|
|
6667
6746
|
|